2 PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
3 VETPACKAGES ?= $(shell go list ./... | grep -v /vendor/ | grep -v /examples/)
4 GOFILES := $(shell find . -name "*.go" -type f -not -path "./vendor/*")
17 $(GOFMT) -w $(GOFILES)
21 # get all go files and run go fmt on them
22 @diff=$$($(GOFMT) -d $(GOFILES)); \
23 if [ -n "$$diff" ]; then \
24 echo "Please run 'make fmt' and commit the result:"; \
33 @hash govendor > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
34 go get -u github.com/kardianos/govendor; \
36 @hash embedmd > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
37 go get -u github.com/campoy/embedmd; \
45 @hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
46 go get -u github.com/golang/lint/golint; \
48 for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
50 .PHONY: misspell-check
52 @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
53 go get -u github.com/client9/misspell/cmd/misspell; \
55 misspell -error $(GOFILES)
59 @hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
60 go get -u github.com/client9/misspell/cmd/misspell; \
62 misspell -w $(GOFILES)