@@ -38,6 +38,9 @@ $(BIN)/golint: PACKAGE=golang.org/x/lint/golint
38
38
STATICCHECK = $(BIN ) /staticcheck
39
39
$(BIN ) /staticcheck : PACKAGE=honnef.co/go/tools/cmd/staticcheck
40
40
41
+ ERRCHECK = $(BIN ) /errcheck
42
+ $(BIN ) /errcheck : PACKAGE=github.com/kisielk/errcheck
43
+
41
44
GOCOV = $(BIN ) /gocov
42
45
$(BIN ) /gocov : PACKAGE=github.com/axw/gocov/...
43
46
@@ -57,10 +60,10 @@ test-verbose: ARGS=-v ## Run tests in verbose mode with coverage repo
57
60
test-race : ARGS=-race # # Run tests with race detector
58
61
$(TEST_TARGETS ) : NAME=$(MAKECMDGOALS:test-%=% )
59
62
$(TEST_TARGETS ) : test
60
- check test tests : fmt lint vet staticcheck; $(info $(M ) running $(NAME:%=% ) tests…) @ # # Run tests
63
+ check test tests : fmt lint vet staticcheck errcheck ; $(info $(M ) running $(NAME:%=% ) tests…) @ # # Run tests
61
64
$Q $(GO ) test -timeout $(TIMEOUT ) s $(ARGS ) $(TESTPKGS )
62
65
63
- test-xml : fmt lint vet staticcheck | $(GO2XUNIT ) ; $(info $(M ) running xUnit tests…) @ # # Run tests with xUnit output
66
+ test-xml : fmt lint vet staticcheck errcheck | $(GO2XUNIT ) ; $(info $(M ) running xUnit tests…) @ # # Run tests with xUnit output
64
67
$Q mkdir -p test
65
68
$Q 2>&1 $(GO ) test -timeout $(TIMEOUT ) s -v $(TESTPKGS ) | tee test/tests.output
66
69
$(GO2XUNIT ) -fail -input test/tests.output -output test/tests.xml
@@ -72,7 +75,7 @@ COVERAGE_HTML = $(COVERAGE_DIR)/index.html
72
75
.PHONY : test-coverage test-coverage-tools
73
76
test-coverage-tools : | $(GOCOV ) $(GOCOVXML )
74
77
test-coverage : COVERAGE_DIR := $(CURDIR ) /test/coverage
75
- test-coverage : fmt lint vet staticcheck test-coverage-tools ; $(info $(M ) running coverage tests…) @ # # Run coverage tests
78
+ test-coverage : fmt lint vet staticcheck errcheck test-coverage-tools ; $(info $(M ) running coverage tests…) @ # # Run coverage tests
76
79
$Q mkdir -p $(COVERAGE_DIR )
77
80
$Q $(GO ) test \
78
81
-coverpkg=$$($(GO ) list -f '{{ join .Deps "\n" }}' $(TESTPKGS ) | \
@@ -99,6 +102,10 @@ vet: ; $(info $(M) running go vet…) @ ## Run go vet on all source files
99
102
staticcheck : | $(STATICCHECK ) ; $(info $(M ) running staticcheck…) @
100
103
$Q $(STATICCHECK ) $(PKGS )
101
104
105
+ .PHONY : errcheck
106
+ errcheck : | $(ERRCHECK ) ; $(info $(M ) running errcheck…) @
107
+ $Q $(ERRCHECK ) $(PKGS )
108
+
102
109
# Misc
103
110
104
111
.PHONY : clean
0 commit comments