From 2f194c67948f02f91bc0cd75625f6152dae6b27f Mon Sep 17 00:00:00 2001 From: lyyyuna Date: Tue, 21 Dec 2021 16:42:54 +0800 Subject: [PATCH] fix: support for tags --- pkg/build/goenv.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/build/goenv.go b/pkg/build/goenv.go index 11914d5..0b8c078 100644 --- a/pkg/build/goenv.go +++ b/pkg/build/goenv.go @@ -92,7 +92,13 @@ func (b *Build) readGOBIN() string { // listPackages list all packages under specific via go list command. func (b *Build) listPackages(dir string) map[string]*Package { - cmd := exec.Command("go", "list", "-json", "./...") + listArgs := []string{"list", "-json"} + if goflags.BuildTags != "" { + listArgs = append(listArgs, "-tags", goflags.BuildTags) + } + listArgs = append(listArgs, "./...") + + cmd := exec.Command("go", listArgs...) cmd.Dir = dir var errBuf bytes.Buffer