1
0
mirror of https://github.com/rancher/os.git synced 2025-04-28 03:20:50 +00:00
os/config/cloudinit/test
2018-09-19 17:18:49 +08:00

28 lines
442 B
Bash
Executable File

#!/bin/bash -e
source build
SRC=$(find . -name '*.go' \
-not -path "./vendor/*")
PKG=$(cd gopath/src/${REPO_PATH}; go list ./... | \
grep --invert-match vendor)
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
echo "Running tests..."
go test -timeout 60s -cover $@ ${PKG} --race
echo "Success"