I would like to add gofmt to the CI/CD pipeline. If it produces changes, I want gofmt to exit with status 1.
For example if I run gofmt -s -l .
and there are some files listed. I want it to exit with status 1. Right now when I run echo $?
gives me 0, even if there are some files listed with gofmt's changes.
I checked the docs and couldn't find a corresponding command line option. Is there a bash hack to do it?