add go vet

This commit is contained in:
Arpad Ryszka 2017-11-05 05:07:20 +01:00
parent 832d0d3d01
commit 327564ae66
2 changed files with 9 additions and 6 deletions

View File

@ -19,9 +19,6 @@ check: imports build $(PARSERS)
check-full: imports build $(PARSERS)
go test
check-fmt: $(SOURCES)
@if [ "$$(gofmt -s -d $(SOURCES))" != "" ]; then false; else true; fi
.coverprofile: $(SOURCES) imports
go test -coverprofile .coverprofile
@ -44,6 +41,12 @@ cpu: cpu.out
fmt: $(SOURCES)
@gofmt -w -s $(SOURCES)
check-fmt: $(SOURCES)
@if [ "$$(gofmt -s -d $(SOURCES))" != "" ]; then false; else true; fi
vet:
@go vet
precommit: fmt build check-full
clean:

View File

@ -234,14 +234,14 @@ func checkJSON(t *testing.T, got, expected interface{}) {
}
if len(v) != len(o) {
t.Error("invalid object length, expected: %d, got: %d", len(v), len(o))
t.Errorf("invalid object length, expected: %d, got: %d", len(v), len(o))
return
}
for key, val := range v {
gotVal, ok := o[key]
if !ok {
t.Error("expected key not found: %s", key)
t.Errorf("expected key not found: %s", key)
return
}
@ -257,7 +257,7 @@ func checkJSON(t *testing.T, got, expected interface{}) {
}
if len(v) != len(a) {
t.Error("invalid array length, expected: %d, got: %d", len(v), len(a))
t.Errorf("invalid array length, expected: %d, got: %d", len(v), len(a))
return
}