No Description

test.sh 315B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. set -e
  3. echo "" > coverage.txt
  4. PKG=$(go list ./... | grep -v /vendor/)
  5. staticcheck $PKG
  6. unused $PKG
  7. go test -v $PKG
  8. for d in $PKG; do
  9. go test -race -coverprofile=profile.out -covermode=atomic $d
  10. if [ -f profile.out ]; then
  11. cat profile.out >> coverage.txt
  12. rm profile.out
  13. fi
  14. done