-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
30 lines (22 loc) · 931 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
default: help
# generate help info from comments: thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## help information about make commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
vet: ## runs go vet
go vet ./...
format: ## runs go fmt
gofmt -s -w .
generate: ## runs go generate
go generate ./...
test: ## runs the unit tests
go test -v -race -timeout 5m ./...
test-cover: ## outputs the coverage statistics
go test -v -race -timeout 5m ./... -coverprofile coverage.out
go tool cover -func coverage.out
rm coverage.out
test-cover-report: ## an html report of the coverage statistics
go test -v ./... -covermode=count -coverpkg=./... -coverprofile coverage.out
go tool cover -html coverage.out -o coverage.html
open coverage.html
lint: ## runs the linter
go generate -v ./lint.go