| # Directory to put `go install`ed binaries in. |
| export GOBIN ?= $(shell pwd)/bin |
| find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ |
| -o -name '*.go' -print | cut -b3-) |
| $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) |
| @gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true |
| @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false) |
| @cd tools && go install golang.org/x/lint/golint |
| @cd tools && go install honnef.co/go/tools/cmd/staticcheck |
| @$(GOBIN)/staticcheck ./... |
| lint: gofmt golint staticcheck |
| go test -coverprofile=cover.out -coverpkg=./... -v ./... |
| go tool cover -html=cover.out -o cover.html |
| @cd tools && go install go.uber.org/tools/update-license |
| @$(GOBIN)/update-license $(GO_FILES) |