-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (25 loc) · 830 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
31
32
33
34
35
.PHONY: lint install-tools test test-race coverage benchmark compare new_to_old membench profile
lint:
go fmt ./...
go vet ./...
revive -config revive.toml -formatter friendly ./...
test:
go test -v -p 1 -count=1 -covermode=count -coverprofile=coverage.out ./...
test-race:
go test -v -p 1 -race -count=1 ./...
install-tools:
go install github.com/matryer/moq
go install github.com/mgechev/revive
go install golang.org/x/perf/cmd/benchstat
coverage:
go tool cover -func coverage.out | grep ^total
benchmark:
go test -run="^Benchmark" -bench=. -count=10 ./... > benchmark_new.txt
compare:
benchstat benchmark_old.txt benchmark_new.txt
new_to_old:
mv benchmark_new.txt benchmark_old.txt
membench:
go test -run="^Benchmark" -bench=. -benchmem ./...
profile:
go tool pprof -http=:8080 ./item/bench_profile.out