Makefile 784 B

1234567891011121314151617181920212223242526272829303132
  1. export GO111MODULE=on
  2. default: fmt vet errcheck test
  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. vet:
  14. go vet ./...
  15. # See https://github.com/kisielk/errcheck/pull/141 for details on ignorepkg
  16. errcheck:
  17. errcheck -ignorepkg fmt github.com/Shopify/sarama/...
  18. fmt:
  19. @if [ -n "$$(go fmt ./...)" ]; then echo 'Please run go fmt on your code.' && exit 1; fi
  20. install_dependencies: install_errcheck get
  21. install_errcheck:
  22. go get github.com/kisielk/errcheck
  23. get:
  24. go get -t