forked from twitchtv/circuitgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (33 loc) · 818 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
export SHELL := /bin/bash
export PATH := $(PWD)/bin:$(PWD):$(PATH)
export GOBIN := $(PWD)/bin
default: test
clean:
@find internal -name "*.gen.go" -exec rm {} \;
.PHONY: clean
generate: clean
go build
go generate ./...
.PHONY: generate
test: lint generate
go test -race ./...
.PHONY: test
install-tools:
@mkdir -p bin
go install github.com/kisielk/errcheck
go install honnef.co/go/tools/cmd/staticcheck
go install golang.org/x/lint/golint
go install golang.org/x/tools/cmd/goimports
go install github.com/securego/gosec/cmd/gosec
.PHONY: install-tools
lint: install-tools
go vet ./...
errcheck -asserts -blank ./...
staticcheck ./...
golint -set_exit_status ./...
gosec -quiet ./...
.PHONY: lint
fix: install-tools
go fmt ./...
find . -iname "*.go" -print0 | xargs -0 goimports -w
.PHONY: fix