blob: 09f743c6d72e3b42bfc50512d46fb65035505f75 [file] [log] [blame]
Scott Baker2d897982019-09-24 11:50:08 -07001export GO111MODULE=on
2
3default: fmt vet errcheck test
4
5# Taken from https://github.com/codecov/example-go#caveat-multiple-files
6test:
7 echo "" > coverage.txt
8 for d in `go list ./... | grep -v vendor`; do \
9 go test -p 1 -v -timeout 240s -race -coverprofile=profile.out -covermode=atomic $$d || exit 1; \
10 if [ -f profile.out ]; then \
11 cat profile.out >> coverage.txt; \
12 rm profile.out; \
13 fi \
14 done
15
16vet:
17 go vet ./...
18
19# See https://github.com/kisielk/errcheck/pull/141 for details on ignorepkg
20errcheck:
21 errcheck -ignorepkg fmt github.com/Shopify/sarama/...
22
23fmt:
24 @if [ -n "$$(go fmt ./...)" ]; then echo 'Please run go fmt on your code.' && exit 1; fi
25
26install_dependencies: install_errcheck get
27
28install_errcheck:
29 go get github.com/kisielk/errcheck
30
31get:
32 go get -t