Skip to content

Instantly share code, notes, and snippets.

View bartlettc22's full-sized avatar

Chris Bartlett bartlettc22

View GitHub Profile
@bartlettc22
bartlettc22 / pre-commit
Created January 31, 2019 20:43
golang pre-commit hook
#!/bin/sh
# Golang pre-commit hook
# Does a `go vet` `gofmt` and `golint` on files to be committed
fail="false"
# Get a list of the go files that staged as part of this commit
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '^[^vendor].*\.go$')
[ -z "$gofiles" ] && exit 0
### Keybase proof
I hereby claim:
* I am bartlettc22 on github.
* I am bartlettc22 (https://keybase.io/bartlettc22) on keybase.
* I have a public key ASCWIjZNBvcyMJrFevB5ZiPKo7lLPC9cW6ZWSqWzKwGAEAo
To claim this, I am signing this object: