]> Cypherpunks.ru repositories - gostls13.git/commit
internal/buildcfg: refactor GOEXPERIMENT parsing code somewhat
authorMatthew Dempsky <mdempsky@google.com>
Fri, 25 Jun 2021 20:24:10 +0000 (13:24 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 27 Jun 2021 05:06:30 +0000 (05:06 +0000)
commitc95464f0ea3f87232b1f3937d1b37da6f335f336
tree2bd7a24f7f2d40506bdbe729041f1afe094be5a2
parented01ceaf4838cd67fd802df481769fa9ae9d0440
internal/buildcfg: refactor GOEXPERIMENT parsing code somewhat

This CL extracts out a ParseGOEXPERIMENT helper function that parses
GOOS/GOARCH/GOEXPERIMENT values and returns active and baseline
experiment flag sets and an error value, without affecting any global
state. This will be used in the subsequent CL for 'go env' support for
GOEXPERIMENT to validate configuration changes.

The existing package initialization for Experiment and
experimentBaseline and also UpdateExperiments are updated to use it as
well.

Change-Id: Ic2ed3fd36d2a6f7f3d8172fccb865e02505c0052
Reviewed-on: https://go-review.googlesource.com/c/go/+/331109
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
src/cmd/go/internal/cfg/cfg.go
src/internal/buildcfg/exp.go