Fix vet warnings

This commit is contained in:
Pauline Middelink 2017-05-17 01:34:33 +02:00
parent 2b9323529f
commit f3d09ce7c8
2 changed files with 7 additions and 7 deletions

View File

@ -170,7 +170,7 @@ func (s *Suite) TestLoad(t *testing.T) {
if err != nil { if err != nil {
t.Errorf("Load(%d, %d) ReadAll() returned unexpected error: %+v", l, o, err) t.Errorf("Load(%d, %d) ReadAll() returned unexpected error: %+v", l, o, err)
if err = rd.Close(); err != nil { 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 continue
} }
@ -178,7 +178,7 @@ func (s *Suite) TestLoad(t *testing.T) {
if l == 0 && len(buf) != len(d) { 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)) 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 { 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 continue
} }
@ -186,7 +186,7 @@ func (s *Suite) TestLoad(t *testing.T) {
if l > 0 && l <= len(d) && len(buf) != l { 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)) 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 { 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 continue
} }
@ -194,7 +194,7 @@ func (s *Suite) TestLoad(t *testing.T) {
if l > len(d) && len(buf) != len(d) { 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)) 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 { 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 continue
} }
@ -202,7 +202,7 @@ func (s *Suite) TestLoad(t *testing.T) {
if !bytes.Equal(buf, d) { if !bytes.Equal(buf, d) {
t.Errorf("Load(%d, %d) returned wrong bytes", l, o) t.Errorf("Load(%d, %d) returned wrong bytes", l, o)
if err = rd.Close(); err != nil { 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 continue
} }

View File

@ -155,7 +155,7 @@ var filterListTests = []struct {
{[]string{"", "*.c"}, "/foo/bar/test.go", false}, {[]string{"", "*.c"}, "/foo/bar/test.go", false},
} }
func TestMatchList(t *testing.T) { func TestList(t *testing.T) {
for i, test := range filterListTests { for i, test := range filterListTests {
match, err := filter.List(test.patterns, test.path) match, err := filter.List(test.patterns, test.path)
if err != nil { 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") match, _ := filter.List([]string{"*.c", "*.go"}, "/home/user/file.go")
fmt.Printf("match: %v\n", match) fmt.Printf("match: %v\n", match)
// Output: // Output: