-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (67 loc) · 1.88 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.PHONY: all
all: clean build test readme lint bench
.PHONY: test
test:
$(info #Running tests...)
go test ./...
.PHONY: cover
cover:
$(info #Running cover tests...)
go test -coverprofile=coverage.out -coverpkg=github.com/m4gshm/gollections/... ./...
go tool cover -html=coverage.out
.PHONY: cover-console-out
cover-console-out:
$(info #Running cover tests...)
go test -coverprofile=coverage.out -coverpkg=github.com/m4gshm/gollections/... ./...
go tool cover -func=coverage.out
.PHONY: clean
clean:
$(info #Building...)
go clean -cache
go clean -testcache
.PHONY: build
build:
$(info #Building...)
# go env -w GOEXPERIMENT=rangefunc,newinliner
go env -w GOEXPERIMENT=rangefunc
go build ./...
.PHONY: builda
builda:
$(info #Building...)
go clean -cache
go build -gcflags -m ./...
.PHONY: bench
bench:
$(info #Running benchmarks...)
# go test -gcflags=-d=loopvar=3 -benchtime 1s -bench . -benchmem ./...
# go env -w GOEXPERIMENT=rangefunc,newinliner
go env -w GOEXPERIMENT=rangefunc
go test -benchtime 1s -bench . -benchmem ./...
.PHONY: update
update:
$(info #Undate tools...)
go install github.com/go-delve/delve/cmd/dlv@latest
go install golang.org/x/tools/gopls@latest
.PHONY: lint
lint:
$(info #Lints...)
go install golang.org/x/tools/cmd/goimports@latest
goimports -w .
# go vet ./...
# go install github.com/tetafro/godot/cmd/godot@latest
# godot .
go install github.com/kisielk/errcheck@latest
errcheck -ignoretests ./...
# go install github.com/alexkohler/nakedret/cmd/nakedret@latest
# nakedret ./...
# go install golang.org/x/lint/golint@latest
# golint ./...
go install github.com/mgechev/revive@latest
revive -exclude internal/... ./...
go install github.com/alexkohler/prealloc@latest
prealloc ./...
.PHONY: readme
readme:
$(info #README.md...)
asciidoctor -b docbook internal/docs/readme.adoc
pandoc -f docbook -t gfm internal/docs/readme.xml -o README.md