pre-commit git hooks for Golang projects
- goimports
- gofmt
# installing goimports
$ go install golang.org/x/tools/cmd/goimports@latest
# installing gofumpt
$ go install mvdan.cc/gofumpt@latest
# clone the repo
git clone --depth=1 https://github.com/Lokesh-Balla/githooks-go.git
# copy githooks from githooks folder to git repository
$ cd githooks-go
$ chmod +x githooks/*
$ cp githooks/* <project_directory>/.git/hooks/