-
Notifications
You must be signed in to change notification settings - Fork 89
/
Makefile
50 lines (37 loc) · 1.02 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
export CGO_ENABLED=0
default: build
ldflags=-ldflags="-s"
build:
go build ${ldflags} -v
build-all:
go build ${ldflags} -v ./...
lint:
golangci-lint run --concurrency=2
lint-fix:
golangci-lint run --concurrency=2 --fix
test:
CGO_ENABLED=1 go test -count=1 -race -covermode=atomic -coverprofile=.testCoverage.txt -timeout=2m .
test-v:
CGO_ENABLED=1 go test -count=1 -race -covermode=atomic -coverprofile=.testCoverage.txt -timeout=2m -v .
cover-view:
go tool cover -func .testCoverage.txt
go tool cover -html .testCoverage.txt
check: test lint
go tool cover -func .testCoverage.txt
bench:
go test -bench=. -run=none -benchmem -benchtime=250000x
tidy:
go mod tidy -v
os=`uname`
gen:
ifeq (${os}, $(filter ${os}, Windows Windows_NT)) # If on windows, there might be something unexpected.
rm -rf ./**/gomock_reflect_*
go generate 2>/dev/null
rm -rf ./**/gomock_reflect_*
else
go generate -v
endif
release-local:
goreleaser release --rm-dist --skip-announce --skip-publish --snapshot
clean:
go clean -r -x -cache -i