mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
Fix vet warnings
This commit is contained in:
parent
2b9323529f
commit
f3d09ce7c8
@ -170,7 +170,7 @@ func (s *Suite) TestLoad(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("Load(%d, %d) ReadAll() returned unexpected error: %+v", l, o, err)
|
||||
if err = rd.Close(); err != nil {
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", err)
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", l, o, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -178,7 +178,7 @@ func (s *Suite) TestLoad(t *testing.T) {
|
||||
if l == 0 && len(buf) != len(d) {
|
||||
t.Errorf("Load(%d, %d) wrong number of bytes read: want %d, got %d", l, o, len(d), len(buf))
|
||||
if err = rd.Close(); err != nil {
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", err)
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", l, o, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -186,7 +186,7 @@ func (s *Suite) TestLoad(t *testing.T) {
|
||||
if l > 0 && l <= len(d) && len(buf) != l {
|
||||
t.Errorf("Load(%d, %d) wrong number of bytes read: want %d, got %d", l, o, l, len(buf))
|
||||
if err = rd.Close(); err != nil {
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", err)
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", l, o, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -194,7 +194,7 @@ func (s *Suite) TestLoad(t *testing.T) {
|
||||
if l > len(d) && len(buf) != len(d) {
|
||||
t.Errorf("Load(%d, %d) wrong number of bytes read for overlong read: want %d, got %d", l, o, l, len(buf))
|
||||
if err = rd.Close(); err != nil {
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", err)
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", l, o, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -202,7 +202,7 @@ func (s *Suite) TestLoad(t *testing.T) {
|
||||
if !bytes.Equal(buf, d) {
|
||||
t.Errorf("Load(%d, %d) returned wrong bytes", l, o)
|
||||
if err = rd.Close(); err != nil {
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", err)
|
||||
t.Errorf("Load(%d, %d) rd.Close() returned error: %+v", l, o, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ var filterListTests = []struct {
|
||||
{[]string{"", "*.c"}, "/foo/bar/test.go", false},
|
||||
}
|
||||
|
||||
func TestMatchList(t *testing.T) {
|
||||
func TestList(t *testing.T) {
|
||||
for i, test := range filterListTests {
|
||||
match, err := filter.List(test.patterns, test.path)
|
||||
if err != nil {
|
||||
@ -171,7 +171,7 @@ func TestMatchList(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleMatchList() {
|
||||
func ExampleList() {
|
||||
match, _ := filter.List([]string{"*.c", "*.go"}, "/home/user/file.go")
|
||||
fmt.Printf("match: %v\n", match)
|
||||
// Output:
|
||||
|
Loading…
Reference in New Issue
Block a user