This command prints gofmt output and ends with a proper error code
gofmt
files="$(gofmt -l .)" && echo "$files" && test -z "$files"