Comment made in the chat: Pre commit hook seems to be ignoring vendor gofmt -l . | grep -v vendor/ >/dev/null 2>&1 it seems to use gofmt not go fmt command though yeah it is that gofmt command. It should be changed to: go fmt $(go list ./... | grep -v /vendor/) |