Skip to content

Instantly share code, notes, and snippets.

@mdsauce
Created August 14, 2019 21:47
Show Gist options
  • Save mdsauce/3f0398e9b10bec6c862e5374c5cf22c9 to your computer and use it in GitHub Desktop.
Save mdsauce/3f0398e9b10bec6c862e5374c5cf22c9 to your computer and use it in GitHub Desktop.
Go pre-commit hook for `.git/hooks` snippet for keeping code formatted
#!/bin/sh
# Must be named 'pre-commit' with no extension
# run go fmt then exit
echo running go fmt tool
go fmt ./...
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment