diff --git a/src/restic/backend/id.go b/src/restic/backend/id.go index 115792707..6c7bc5321 100644 --- a/src/restic/backend/id.go +++ b/src/restic/backend/id.go @@ -44,11 +44,7 @@ func (id ID) String() string { const shortStr = 4 // Str returns the shortened string version of id. -func (id *ID) Str() string { - if id == nil { - return "[nil]" - } - +func (id ID) Str() string { if id.IsNull() { return "[null]" } diff --git a/src/restic/backend/id_int_test.go b/src/restic/backend/id_int_test.go index d46a1554b..ed84a5a37 100644 --- a/src/restic/backend/id_int_test.go +++ b/src/restic/backend/id_int_test.go @@ -8,9 +8,4 @@ func TestIDMethods(t *testing.T) { if id.Str() != "[null]" { t.Errorf("ID.Str() returned wrong value, want %v, got %v", "[null]", id.Str()) } - - var pid *ID - if pid.Str() != "[nil]" { - t.Errorf("ID.Str() returned wrong value, want %v, got %v", "[nil]", pid.Str()) - } }