Files
matchbox/test
Dalton Hubble 798be8bdb8 bootcfg: Add bootcfg gRPC client and server packages
* Add standalone gRPC binary example
2016-03-04 11:31:33 -08:00

25 lines
522 B
Bash
Executable File

#!/bin/bash -e
PKGS=$(go list ./... | grep -v /vendor)
FORMATTABLE="./api ./config ./cmd ./sign"
LINT_EXCLUDE='(/vendor|pb$)'
LINTABLE=$(go list ./... | grep -v -E $LINT_EXCLUDE)
go test $PKGS -cover
go vet $PKGS
echo "Checking gofmt..."
fmtRes=$(gofmt -l $FORMATTABLE)
if [ -n "${fmtRes}" ]; then
echo -e "gofmt checking failed:\n${fmtRes}"
exit 2
fi
echo "Checking golint..."
lintRes=$(echo $LINTABLE | xargs -n 1 golint)
if [ -n "${lintRes}" ]; then
echo -e "golint checking failed:\n${lintRes}"
exit 2
fi