Skip to content

Instantly share code, notes, and snippets.

@xla
Created January 23, 2012 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xla/e689d5de0982543cce8c to your computer and use it in GitHub Desktop.
Save xla/e689d5de0982543cce8c to your computer and use it in GitHub Desktop.
#!/bin/sh
for file in $(git diff --cached --name-status | awk '{print $2}')
do
gofmt -w $file
git add $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment