Makefile 761 B

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