Makefile 669 B

1234567891011121314151617181920212223242526272829
  1. default: fmt vet errcheck test
  2. # Taken from https://github.com/codecov/example-go#caveat-multiple-files
  3. test:
  4. echo "" > coverage.txt
  5. for d in `go list ./... | grep -v vendor`; do \
  6. go test -p 1 -v -timeout 90s -race -coverprofile=profile.out -covermode=atomic $$d || exit 1; \
  7. if [ -f profile.out ]; then \
  8. cat profile.out >> coverage.txt; \
  9. rm profile.out; \
  10. fi \
  11. done
  12. vet:
  13. go vet ./...
  14. errcheck:
  15. errcheck github.com/Shopify/sarama/...
  16. fmt:
  17. @if [ -n "$$(go fmt ./...)" ]; then echo 'Please run go fmt on your code.' && exit 1; fi
  18. install_dependencies: install_errcheck get
  19. install_errcheck:
  20. go get github.com/kisielk/errcheck
  21. get:
  22. go get -t