Skip to content

Commit 5eda0fc

Browse files
committed
fix the git hooks vendor filtering
Some go vet errors are multi-line, so filtering on 'vendor' at the far end was still letting some things through. Filter the input files instead.
1 parent 333e4cc commit 5eda0fc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎git-hooks/pre-commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ check_go_vet() {
3131
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v go/vendor/)
3232
[ -z "$gofiles" ] && return 0
3333

34-
warnings=$(go vet ./... 2>&1 | grep -v vendor)
34+
warnings=$(go vet $(go list ./... | grep -v vendor) 2>&1)
3535
[ -z "$warnings" ] && return 0
3636

3737
# go vet found issues

0 commit comments

Comments
 (0)