From 7dd9ced59a57fd0450c02be75150203a3403e6f3 Mon Sep 17 00:00:00 2001 From: Javier Domingo Cansino Date: Wed, 27 May 2020 10:39:49 +0200 Subject: [PATCH 1/2] Make go list run with non-root packages --- run-go-vet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-go-vet.sh b/run-go-vet.sh index 0d21ea4..d3b45c1 100755 --- a/run-go-vet.sh +++ b/run-go-vet.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -pkg=$(go list) +pkg=$(go list ./...) for dir in $(echo $@|xargs -n1 dirname|sort -u); do go vet $pkg/$dir done From e3733ddeefd5f73d40052a8963d4f184b6bb7a49 Mon Sep 17 00:00:00 2001 From: Javier Domingo Cansino Date: Fri, 18 Sep 2020 11:07:05 +0200 Subject: [PATCH 2/2] Support roots with multiple packages --- run-go-vet.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run-go-vet.sh b/run-go-vet.sh index d3b45c1..893b535 100755 --- a/run-go-vet.sh +++ b/run-go-vet.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e -pkg=$(go list ./...) -for dir in $(echo $@|xargs -n1 dirname|sort -u); do - go vet $pkg/$dir +for pkg in $(go list ./...); do + for dir in $(echo $@|xargs -n1 dirname|sort -u); do + go vet $pkg/$dir + done done