blob: ce52dd19d48aa0728a711a5e1ab57163782c90cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# If there is a GOPATH use it, otherwise we define our own. This is not exported
# and should not impact the Go modules system.
GOPATH?= $(shell go env GOPATH)
SRC= $(shell find . -type f -name '*.go')
export GO111MODULE=on
export CGO_ENABLED=0
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
|awk 'BEGIN{FS=":.*?## "};{printf "\033[36m%-30s\033[0m %s\n",$$1,$$2}'
.PHONY: test
test: lint ## Run tests and create coverage report
go test -short -coverprofile=coverage.txt -covermode=atomic ./...
go tool cover -html=coverage.txt -o coverage.html
lint: ## Lint code
revive ./... || golint -set_exit_status ./... || true
.PHONY: clean
clean: ## Clean up temp files and binaries
rm -rf coverage*
|