aboutsummaryrefslogtreecommitdiff
path: root/run_tests.sh
blob: 3b27193098e4fbc253e8cdc11398767f8f2b3e24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh

# This can be used as a pre-commit script.  Just run
#   cp run_tests.sh .git/hooks/pre-commit
# and it will run before each commit.

set -xue

go install -race -v ./cmd/cashier ./cmd/cashierd
go list ./... |grep -v vendor/ |xargs go test -race
gofmt -d $(find * -type f -name '*.go' -not -path 'vendor/*')
go list ./... |grep -v vendor/ |xargs go vet
if ! type -f golint > /dev/null; then
  go get -u github.com/golang/lint/golint
fi
go list ./... |egrep -v 'vendor/|proto$' |xargs -L1 golint -set_exit_status