Commit 9920fea5 authored by Andrzej Wasylkowski's avatar Andrzej Wasylkowski

Fixed the issue with formatting issues not being reported when verification fails.

parent 1168552f
...@@ -48,7 +48,11 @@ find_files() { ...@@ -48,7 +48,11 @@ find_files() {
\) -name '*.go' \) -name '*.go'
} }
diff=$(find_files | xargs ${gofmt} -d -s 2>&1) # gofmt exits with non-zero exit code if it finds a problem unrelated to
# formatting (e.g., a file does not parse correctly). Without "|| true" this
# would have led to no useful error message from gofmt, because the script would
# have failed before getting to the "echo" in the block below.
diff=$(find_files | xargs ${gofmt} -d -s 2>&1) || true
if [[ -n "${diff}" ]]; then if [[ -n "${diff}" ]]; then
echo "${diff}" echo "${diff}"
exit 1 exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment