mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
cmd/go: make cfg.BuildContext.ToolTags same order with build.Default.ToolTags
So it's consistent when running "go list -f '{{context.ToolTags}}'" and printing the content of "build.Default.ToolTags". Updates #45454 Change-Id: I7a3cbf3cdf9a6ce2b8c89e9bcf5fc5e9086d48e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/422615 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
535fe2b226
commit
be26aa70d4
|
@ -237,9 +237,12 @@ func init() {
|
||||||
CleanGOEXPERIMENT = Experiment.String()
|
CleanGOEXPERIMENT = Experiment.String()
|
||||||
|
|
||||||
// Add build tags based on the experiments in effect.
|
// Add build tags based on the experiments in effect.
|
||||||
for _, exp := range Experiment.Enabled() {
|
exps := Experiment.Enabled()
|
||||||
BuildContext.ToolTags = append(BuildContext.ToolTags, "goexperiment."+exp)
|
expTags := make([]string, 0, len(exps)+len(BuildContext.ToolTags))
|
||||||
|
for _, exp := range exps {
|
||||||
|
expTags = append(expTags, "goexperiment."+exp)
|
||||||
}
|
}
|
||||||
|
BuildContext.ToolTags = append(expTags, BuildContext.ToolTags...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// An EnvVar is an environment variable Name=Value.
|
// An EnvVar is an environment variable Name=Value.
|
||||||
|
|
Loading…
Reference in a new issue