test 444 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash -e
  2. source ./build
  3. SRC=$(find . -name '*.go' \
  4. -not -path "./vendor/*")
  5. PKG=$(cd gopath/src/${REPO_PATH}; go list ./... | \
  6. grep --invert-match vendor)
  7. echo "Checking gofix..."
  8. go tool fix -diff $SRC
  9. echo "Checking gofmt..."
  10. res=$(gofmt -d -e -s $SRC)
  11. echo "${res}"
  12. if [ -n "${res}" ]; then
  13. exit 1
  14. fi
  15. echo "Checking govet..."
  16. go vet $PKG
  17. echo "Running tests..."
  18. go test -timeout 60s -cover $@ ${PKG} --race
  19. echo "Success"