goarch string // Target GOARCH
cgoEnabled bool
goExperiment string
+ goDebug string
// dirs are the directories to look for *.go files in.
// TODO(bradfitz): just use all directories?
GOOS string
GOARCH string
GOEXPERIMENT string
+ GODEBUG string
CGO_ENABLED string
}
if err := json.NewDecoder(stdout).Decode(&env); err != nil {
goarch = env.GOARCH
cgoEnabled, _ = strconv.ParseBool(env.CGO_ENABLED)
goExperiment = env.GOEXPERIMENT
+ goDebug = env.GODEBUG
common := testCommon{
gorootTestDir: filepath.Join(testenv.GOROOT(t), "test"),
}
goexp := goExperiment
+ godebug := goDebug
// collect flags
for len(args) > 0 && strings.HasPrefix(args[0], "-") {
goexp += args[0]
runenv = append(runenv, "GOEXPERIMENT="+goexp)
+ case "-godebug": // set GODEBUG environment
+ args = args[1:]
+ if godebug != "" {
+ godebug += ","
+ }
+ godebug += args[0]
+ runenv = append(runenv, "GODEBUG="+godebug)
+
default:
flags = append(flags, args[0])
}
runInDir = ""
var out []byte
var err error
- if len(flags)+len(args) == 0 && t.goGcflagsIsEmpty() && !*linkshared && goarch == runtime.GOARCH && goos == runtime.GOOS && goexp == goExperiment {
+ if len(flags)+len(args) == 0 && t.goGcflagsIsEmpty() && !*linkshared && goarch == runtime.GOARCH && goos == runtime.GOOS && goexp == goExperiment && godebug == goDebug {
// If we're not using special go command flags,
// skip all the go command machinery.
// This avoids any time the go command would