fix: support for tags

This commit is contained in:
lyyyuna 2021-12-21 16:42:54 +08:00 committed by Li Yiyang
parent cb4bdfb582
commit 2f194c6794

View File

@ -92,7 +92,13 @@ func (b *Build) readGOBIN() string {
// listPackages list all packages under specific via go list command. // listPackages list all packages under specific via go list command.
func (b *Build) listPackages(dir string) map[string]*Package { 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 cmd.Dir = dir
var errBuf bytes.Buffer var errBuf bytes.Buffer