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