Matt Jeanneret | cab955f | 2019-04-10 15:45:57 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | TEST=./...; |
| 4 | FMT="*.go" |
| 5 | |
| 6 | echo "Running tests..."; |
| 7 | go test -v -cover -cpu 1,2,4 $TEST; |
| 8 | go test -v -cover -cpu 1,2,4 -race $TEST; |
| 9 | |
| 10 | echo "Checking gofmt..." |
| 11 | fmtRes=$(gofmt -l -s $FMT) |
| 12 | if [ -n "${fmtRes}" ]; then |
| 13 | echo -e "gofmt checking failed:\n${fmtRes}" |
| 14 | exit 255 |
| 15 | fi |
| 16 | |
| 17 | echo "Checking govet..." |
| 18 | vetRes=$(go vet $TEST) |
| 19 | if [ -n "${vetRes}" ]; then |
| 20 | echo -e "govet checking failed:\n${vetRes}" |
| 21 | exit 255 |
| 22 | fi |
| 23 | |
| 24 | echo "Success"; |