Install goimports if needed (travis)

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
pull/157/head
Andy Goldstein 2017-10-30 13:51:04 -04:00
parent c1bc52eb65
commit 39f0a4e561
2 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,8 @@ HACK_DIR=$(dirname "${BASH_SOURCE}")
echo "Updating formatting"
gofmt -w -s $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
command -v goimports > /dev/null || go get golang.org/x/tools/cmd/goimports
goimports -w -d $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
echo "Success!"

View File

@ -26,6 +26,7 @@ fi
echo "Success!"
echo "Verifying goimports"
command -v goimports > /dev/null || go get golang.org/x/tools/cmd/goimports
goimports -l $(find . -type f -name "*.go" -not -path "./vendor/*" -not -path "./pkg/generated/*" -not -name "zz_generated*")
echo "Success!"