-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
30 lines (24 loc) · 821 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
all:
go install golang.org/x/tools/...@latest
go generate
go test
golangci-lint run
coverageO:
go install github.com/eltorocorp/drygopher/drygopher@latest
-drygopher -s 80
go tool cover -html=coverage.out
calculate_coverage:
echo "mode: atomic" > coverage.txt
for d in $$(go list ./...); do \
go test -race -covermode=atomic -coverprofile=profile.out -coverpkg=github.com/muir/libschema/... $$d; \
if [ -f profile.out ]; then \
grep -v ^mode profile.out >> coverage.txt; \
rm profile.out; \
fi; \
done
coverage: calculate_coverage
go tool cover -html=coverage.txt
golanglint:
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.45.2
golangci-lint --version