Skip to content

Instantly share code, notes, and snippets.

@danackerson
Last active February 20, 2024 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danackerson/b6f276f9979924c4836e5aef2f859291 to your computer and use it in GitHub Desktop.
Save danackerson/b6f276f9979924c4836e5aef2f859291 to your computer and use it in GitHub Desktop.
govulncheck pre-commit hook for golang projects
$ git config --global init.templateDir ~/.git-template
$ vi ~/.git-template/hooks/pre-commit
#!/usr/bin/env bash
set -e -o pipefail
if [[ -f "go.sum" ]]; then
govulncheck ./...
fi
$ cd <git repo>
$ git init
$ git commit ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment