-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (18 loc) · 887 Bytes
/
Makefile
File metadata and controls
25 lines (18 loc) · 887 Bytes
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
CWD=$$(pwd)
PKG_LIST := $(shell go list ${CWD}/...)
.PHONY: dep test coverage coverhtml lint
lint: ## Lint the files, execute after make dep
@gofmt -w pkg/ examples/
@go vet .
@golangci-lint run
@go mod tidy
coverage: ## Generate global code coverage report ()
@go test -covermode=atomic -coverprofile coverage.out -v ./...
coverhtml: coverage ## Generate global code coverage report in HTML
@go tool cover -html=coverage.out -o coverage.html
dep: ## Get the test/lint dependencies
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
test: ## Run all go-based tests
go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'