Skip to content

Instantly share code, notes, and snippets.

@deckarep
Forked from mboersma/Go pre-commit
Created September 7, 2016 22:32
Show Gist options
  • Save deckarep/55be6043b45803501c8f1e3fad54ede5 to your computer and use it in GitHub Desktop.
Save deckarep/55be6043b45803501c8f1e3fad54ede5 to your computer and use it in GitHub Desktop.
Go project pre-commit hook
#!/bin/sh
# Save this file as ".git/hooks/pre-commit" in your
# git repository and set it to executable.
#
# To use the "go vet" command:
# $ go get -v code.google.com/p/go.tools/cmd/vet
# To use the "golint" command:
# $ go get -v github.com/golang/lint/golint
go fmt ./...
go vet ./...
golint .
go test ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment