| 1 |
|
| 2 |
build: |
| 3 |
go build -v ./... |
| 4 |
|
| 5 |
test: |
| 6 |
go test -race -v ./... |
| 7 |
watch-test: |
| 8 |
reflex -t 50ms -s -- sh -c 'gotest -race -v ./...' |
| 9 |
|
| 10 |
bench: |
| 11 |
go test -benchmem -count 3 -bench ./... |
| 12 |
watch-bench: |
| 13 |
reflex -t 50ms -s -- sh -c 'go test -benchmem -count 3 -bench ./...' |
| 14 |
|
| 15 |
coverage: |
| 16 |
go test -v -coverprofile=cover.out -covermode=atomic ./... |
| 17 |
go tool cover -html=cover.out -o cover.html |
| 18 |
|
| 19 |
tools: |
| 20 |
go install github.com/cespare/reflex@latest |
| 21 |
go install github.com/rakyll/gotest@latest |
| 22 |
go install github.com/psampaz/go-mod-outdated@latest |
| 23 |
go install github.com/jondot/goweight@latest |
| 24 |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
| 25 |
go get -t -u golang.org/x/tools/cmd/cover |
| 26 |
go install github.com/sonatype-nexus-community/nancy@latest |
| 27 |
go mod tidy |
| 28 |
|
| 29 |
lint: |
| 30 |
golangci-lint run --timeout 60s --max-same-issues 50 ./... |
| 31 |
lint-fix: |
| 32 |
golangci-lint run --timeout 60s --max-same-issues 50 --fix ./... |
| 33 |
|
| 34 |
audit: |
| 35 |
go list -json -m all | nancy sleuth |
| 36 |
|
| 37 |
outdated: |
| 38 |
go list -u -m -json all | go-mod-outdated -update -direct |
| 39 |
|
| 40 |
weight: |
| 41 |
goweight |