Skip to content

Commit 5926358

Browse files
authored
Merge pull request #161 from q384566678/makefile-test-fix
Makefile: add gofmt and govet to test
2 parents db21b15 + 3ace3ab commit 5926358

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,20 @@ lint:
5757
@echo "checking lint"
5858
@./.tool/lint
5959

60-
test:
61-
go test -v -race -cover $(shell go list ./... | grep -v /vendor/)
60+
.PHONY: .gofmt .govet .gotest
61+
62+
PACKAGES = $(shell go list ./... | grep -v /vendor/)
63+
test: .gofmt .govet .gotest
64+
65+
FILES = $(shell find ./ -name *.go | grep -v vendor)
66+
.gofmt:
67+
OUT=$$(gofmt -s -d $(FILES)); if test -n "$${OUT}"; then echo "$${OUT}" && exit 1; fi
68+
69+
.govet:
70+
go vet -x $(PACKAGES)
71+
72+
.gotest:
73+
go test -v -race -cover $(PACKAGES)
6274

6375

6476
## this uses https://github.com/Masterminds/glide and https://github.com/sgotti/glide-vc

0 commit comments

Comments
 (0)