Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another option for fixing the go vet script #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arschles
Copy link

alternative to #62, see that PR for context on this one

Comment on lines +5 to +6
for fn in "$@"; do
go vet "${pkg}/${fn}"
Copy link
Owner

@dnephin dnephin Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? go help vet claims it runs against packages not files.

My suggestion here was something like this:

for dir in $(echo $@ | xargs -n1 dirname | sort -u); do
    go vet $(go list ./$dir)
done

Copy link
Author

@arschles arschles Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, with go 1.13, you can run it against files. Here's a test:

keda on 🌲 http Go 🐹  v1.13.8 go vet main.go

keda on 🌲 http Go 🐹  v1.13.8   echo $?
0

I believe this is possible for later versions as well. Not sure about previous. Unfortunately I don't have time at the moment to go check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants