Open dandv opened 7 years ago
This failed build shows that
test -z $(gofmt -l $(find . -name '*.go'))
doesn't actually "list files whose formatting differs from gofmt's" as the help for -l claims.
-l
find . -name '*.go' | xargs gofmt -l does display the offending files.
find . -name '*.go' | xargs gofmt -l
test ... will fail the build, which the other command won't... We need the best of both worlds.
test ...
badfiles=$(find . -name '*.go' | xargs gofmt -l); echo $badfiles; test -z $badfiles
This failed build shows that
doesn't actually "list files whose formatting differs from gofmt's" as the help for
-l
claims.find . -name '*.go' | xargs gofmt -l
does display the offending files.