internal/restic: Remove unused ID.EqualString
This commit is contained in:
parent
6922360179
commit
e0b743c64d
2 changed files with 0 additions and 21 deletions
|
@ -82,19 +82,6 @@ func (id ID) Equal(other ID) bool {
|
||||||
return id == other
|
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.
|
// MarshalJSON returns the JSON encoding of id.
|
||||||
func (id ID) MarshalJSON() ([]byte, error) {
|
func (id ID) MarshalJSON() ([]byte, error) {
|
||||||
buf := make([]byte, 2+hex.EncodedLen(len(id)))
|
buf := make([]byte, 2+hex.EncodedLen(len(id)))
|
||||||
|
|
|
@ -30,14 +30,6 @@ func TestID(t *testing.T) {
|
||||||
t.Errorf("ID.Equal() does not work as expected")
|
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
|
// test json marshalling
|
||||||
buf, err := id.MarshalJSON()
|
buf, err := id.MarshalJSON()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue