mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-03-21 23:43:40 +00:00
35 lines
697 B
Bash
Executable File
35 lines
697 B
Bash
Executable File
#!/bin/bash -eu
|
|
|
|
source ./build
|
|
|
|
SRC=$(find . -name '*.go' \
|
|
-not -path "./internal/vendor/*" \
|
|
-not -path "./config/vendor/*" \
|
|
-not -path "./config/v1/vendor/*")
|
|
|
|
PKG=$(cd gopath/src/${REPO_PATH}; go list ./... | \
|
|
grep --invert-match vendor)
|
|
|
|
# https://github.com/golang/go/issues/15067
|
|
PKG_VET=$(cd gopath/src/${REPO_PATH}; go list ./... | \
|
|
grep --invert-match vendor | \
|
|
grep --invert-match internal/log)
|
|
|
|
echo "Checking gofix..."
|
|
go tool fix -diff $SRC
|
|
|
|
echo "Checking gofmt..."
|
|
res=$(gofmt -d -e -s $SRC)
|
|
echo "${res}"
|
|
if [ -n "${res}" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
echo "Checking govet..."
|
|
go vet $PKG_VET
|
|
|
|
echo "Running tests..."
|
|
go test -timeout 60s -cover $@ ${PKG} --race
|
|
|
|
echo "Success"
|