-
Archives
- July 2015
- September 2014
- June 2014
- April 2014
- January 2014
- August 2013
- February 2013
- November 2012
- September 2012
- August 2012
- July 2012
- February 2012
- January 2012
- November 2011
- September 2011
- August 2011
- December 2010
- July 2010
- February 2010
- December 2009
- November 2009
- September 2009
- July 2009
- June 2009
-
Meta
Monthly Archives: September 2012
Making sure go source passes gofmt before committing
Here is a nice little snippet to make sure your go code passes gofmt before committing. Put this in .git/hooks/pre-commit: #!/bin/sh set -e d=`mktemp -d –tmpdir gofmtcheck-XXXXXX` git checkout-index –prefix “$d/” -a ret=`find . -regex ‘.*\.go$’ -exec gofmt -d ‘{}’ … Continue reading
Posted in Uncategorized
1 Comment