forked from jefferyjob/go-redislock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 746 Bytes
/
Makefile
File metadata and controls
30 lines (24 loc) · 746 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
26
27
28
29
30
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY:build
build: ## 编译项目
go build -v ./...
.PHONY:test
test: ## 运行测试
go test -v ./...
.PHONY:lint
lint: ## 执行代码静态分析
golangci-lint run
.PHONY:bench
bench: ## 运行基准测试
go test -benchmem -bench .
.PHONY:doc
doc: ## 启动文档服务器
godoc -http=:6060 -play -index
.PHONY:cover
cover: ## 生成测试覆盖率报告
#go tool cover -func=coverage.out
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY:help
.DEFAULT_GOAL:=help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'