I'm trying to run a format command on code before it's committed. I ether want it to not allow commit if unformatted or automatically do it before committing.
What happens now is the commit happens and the formatting is applied after the commit as unstaged changes.
Here is my .git/hooks/pre-commit
:
#!/bin/bash
go fmt src/*.go