Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions hack/verify-gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GO_VERSION=($(go version))

GO_VERSION=($(go version))

if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3') ]]; then
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4') ]]; then
echo "Unknown go version '${GO_VERSION}', skipping gofmt."
exit 0
fi
Expand All @@ -35,10 +35,11 @@ find_files() {
\) -name '*.go'
}

bad_files=$(find_files | xargs gofmt -s -l)
GOFMT="gofmt -s"
bad_files=$(find_files | xargs ${GOFMT} -l)
if [[ -n "${bad_files}" ]]; then
echo "!!! gofmt needs to be run on the following files: "
echo "!!! '${GOFMT}' needs to be run on the following files: "
echo "${bad_files}"
echo "Try running 'gofmt -s -d [path]'"
echo "Try running '${GOFMT} -d [path]'"
exit 1
fi