internal/restic: Remove unused ID.EqualString

This commit is contained in:
greatroar 2022-10-14 18:07:58 +02:00
parent 6922360179
commit e0b743c64d
2 changed files with 0 additions and 21 deletions

View File

@ -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)))

View File

@ -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 {