add go vet
This commit is contained in:
parent
832d0d3d01
commit
327564ae66
9
Makefile
9
Makefile
@ -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:
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user