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