Files
matchbox/scripts/test
Dalton Hubble 219da4d934 *: Switch to a Makefile driven develop/release process
* Add make targets for vendor, docker-image, and tools
* Move scripts into the scripts folder
2017-01-18 02:11:27 -08:00

25 lines
524 B
Bash
Executable File

#!/bin/bash -e
PKGS=$(go list ./... | grep -v /vendor)
FORMATTABLE="$(ls -d */ | grep -v vendor/)"
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