mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
23 lines
462 B
Bash
Executable File
23 lines
462 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
PKGS=$(go list ./... | grep -v /examples)
|
|
FORMATTABLE="$(ls -d */)"
|
|
LINTABLE=$(go list ./...)
|
|
|
|
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 |