Makefile (1103B)
1 help: ## show help, shown by default if no target is specified 2 @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 4 lint: ## run code linters 5 golangci-lint run 6 7 benchmark: ## run benchmarks 8 cd benchmarks && perflock go test -cpu 8 -run=^# -bench=. 9 10 benchmark-perflock: ## run benchmarks using perflock - https://github.com/aclements/perflock 11 cd benchmarks && perflock -governor 80% go test -count 3 -cpu 8 -run=^# -bench=. 12 13 test: ## run tests 14 go test -race ./... 15 GOARCH=386 go test ./... 16 17 test-coverage: ## run unit tests and create test coverage 18 go test ./... -coverprofile .testCoverage -covermode=atomic -coverpkg=./... 19 20 test-coverage-web: test-coverage ## run unit tests and show test coverage in browser 21 go tool cover -func .testCoverage | grep total | awk '{print "Total coverage: "$$3}' 22 go tool cover -html=.testCoverage 23 24 install-linters: ## install all used linters 25 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.49.0