Skip to content

Instantly share code, notes, and snippets.

@mboersma
Last active December 6, 2017 02:00
Show Gist options
  • Save mboersma/11333125 to your computer and use it in GitHub Desktop.
Save mboersma/11333125 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 ./...
@peterhellberg
Copy link

go vet is now be installed with go get -v -u golang.org/x/tools/cmd/vet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment