From e0b743c64d87ef9dbb10fec690055f947a6e9c44 Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Fri, 14 Oct 2022 18:07:58 +0200 Subject: [PATCH] internal/restic: Remove unused ID.EqualString --- internal/restic/id.go | 13 ------------- internal/restic/id_test.go | 8 -------- 2 files changed, 21 deletions(-) diff --git a/internal/restic/id.go b/internal/restic/id.go index 6d85ed68a..5a25e0ebe 100644 --- a/internal/restic/id.go +++ b/internal/restic/id.go @@ -82,19 +82,6 @@ func (id ID) Equal(other ID) bool { return id == other } -// EqualString compares this ID to another one, given as a string. -func (id ID) EqualString(other string) (bool, error) { - s, err := hex.DecodeString(other) - if err != nil { - return false, errors.Wrap(err, "hex.DecodeString") - } - - id2 := ID{} - copy(id2[:], s) - - return id == id2, nil -} - // MarshalJSON returns the JSON encoding of id. func (id ID) MarshalJSON() ([]byte, error) { buf := make([]byte, 2+hex.EncodedLen(len(id))) diff --git a/internal/restic/id_test.go b/internal/restic/id_test.go index ff1dc54e0..9a9fddcda 100644 --- a/internal/restic/id_test.go +++ b/internal/restic/id_test.go @@ -30,14 +30,6 @@ func TestID(t *testing.T) { t.Errorf("ID.Equal() does not work as expected") } - ret, err := id.EqualString(test.id) - if err != nil { - t.Error(err) - } - if !ret { - t.Error("ID.EqualString() returned wrong value") - } - // test json marshalling buf, err := id.MarshalJSON() if err != nil {