forked from guanguans/id-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 891 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
# note: call scripts from /scripts
GOCMD=GO111MODULE=on go
GOTESTCMD=GO111MODULE=on gotest
LOCALCMD=/usr/local/bin
GOBINCMD=/Users/yaozm/go/bin
linters-install:
@golangci-lint --version >/dev/null 2>&1 || { \
echo "installing linting tools..."; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0; \
}
lint: linters-install
$(LOCALCMD)/golangci-lint run ./...
gosec-install:
@gosec --version >/dev/null 2>&1 || { \
echo "installing gosec tools..."; \
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest ; \
}
gosec: gosec-install
$(GOBINCMD)/gosec ./...
fmt:
$(GOCMD) fmt ./...
vet:
$(GOCMD) vet ./...
test:
$(GOTESTCMD) -v -cover -coverprofile=cover.out
cover:
$(GOCMD) tool cover -html=cover.out
bench:
$(GOTESTCMD) -bench=. -benchmem ./...