-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 763 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
36
37
38
39
40
41
42
43
BIN = ${PWD}/bin
.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./cmd/url-parser
.PHONY: check
check: cs vet staticcheck test
.PHONY: cs
cs: tools
diff=$$($(BIN)/goimports -d . ); test -z "$$diff" || (echo "$$diff" && exit 1)
.PHONY: cs-fix
cs-fix: format
.PHONY: format
format: tools
$(BIN)/goimports -w .
.PHONY: vet
vet:
go vet ./...
.PHONY: test
test:
timeout 10 go test
timeout 60 go test --race
timeout 120 go test --count 1000
timeout 10 cmd/url-parser/main_test.sh
.PHONY: staticcheck
staticcheck: tools
$(BIN)/staticcheck ./...
.PHONY: tools
tools: bin
bin: export GOBIN = $(BIN)
bin:
go install golang.org/x/lint/golint
go install golang.org/x/tools/cmd/goimports
go install honnef.co/go/tools/cmd/staticcheck