Merge pull request #1214 from luoliwoshang/emb/esp32/tag

internal/build:include target build-tags in Go package compilation
This commit is contained in:
xushiwei
2025-08-19 08:30:56 +08:00
committed by GitHub

View File

@@ -170,6 +170,9 @@ func Do(args []string, conf *Config) ([]Package, error) {
if conf.Tags != "" { if conf.Tags != "" {
tags += "," + conf.Tags tags += "," + conf.Tags
} }
if len(export.BuildTags) > 0 {
tags += "," + strings.Join(export.BuildTags, ",")
}
cfg := &packages.Config{ cfg := &packages.Config{
Mode: loadSyntax | packages.NeedDeps | packages.NeedModule | packages.NeedExportFile, Mode: loadSyntax | packages.NeedDeps | packages.NeedModule | packages.NeedExportFile,
BuildFlags: []string{"-tags=" + tags}, BuildFlags: []string{"-tags=" + tags},