This repository was archived by the owner on Mar 12, 2025. It is now read-only.
another option for fixing the go vet script#63
Open
arschles wants to merge 2 commits intodnephin:masterfrom
Open
another option for fixing the go vet script#63arschles wants to merge 2 commits intodnephin:masterfrom
arschles wants to merge 2 commits intodnephin:masterfrom
Conversation
4 tasks
dnephin
reviewed
Oct 27, 2020
Comment on lines
+5
to
+6
| for fn in "$@"; do | ||
| go vet "${pkg}/${fn}" |
Owner
There was a problem hiding this comment.
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
Author
There was a problem hiding this comment.
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 $?
0I 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alternative to #62, see that PR for context on this one