-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (24 loc) · 1.01 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
export GO111MODULE=on
export PACKAGE=`go list`
default: build build-cmd lint test
build:
go build
build-cmd:
go build -o ./cmd/chance/chance ./cmd/chance
format:
which goimports || go get -u golang.org/x/tools/cmd/goimports
find $(PWD) -type f -name "*.go" | xargs -n 1 -I R goimports -w R
find $(PWD) -type f -name "*.go" | xargs -n 1 -I R gofmt -s -w R
lint:
go fmt $(PACKAGE)/... # fixme
go vet $(PACKAGE)/... # fixme
which gocyclo || go get -u github.com/fzipp/gocyclo
find $(PWD) -type f -name "*.go" | xargs -n 1 -I {} gocyclo -over 15 {} # fixme
which golint || go get -u golang.org/x/lint/golint
go list $(PACKAGE)/... | xargs -n 1 -I {} golint {} # fixme
which ineffassign || go get -u github.com/gordonklaus/ineffassign
find $(PWD) -type f -name "*.go" | xargs -n 1 -I {} ineffassign {} # fixme
which misspell || go get -u github.com/client9/misspell/cmd/misspell
find $(PWD) -type f -name "*.go" | xargs -n 1 -I {} misspell {} # fixme
test:
go test -race -coverprofile=coverage.txt -covermode=atomic