My goal is to enforce the formatting of go source code on commit. Is there a way to find out if running go fmt
over a file/set of files would make any changes? The only technique I can think of is to:
- store the current time t
- run go fmt over the source
- iterate the source files to see if any of the last mod dates > t
I could write a tool/script to do this and execute during circle CI build. I wanted to check that I'm not reinventing the wheel before I go ahead.