mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: introduce GODEBUG env var
Currently it replaces GOGCTRACE env var (GODEBUG=gctrace=1). The plan is to extend it with other type of debug tracing, e.g. GODEBUG=gctrace=1,schedtrace=100. R=rsc CC=bradfitz, daniel.morsing, gobot, golang-dev https://golang.org/cl/10026045
This commit is contained in:
parent
1e112cd59f
commit
4b536a550f
8 changed files with 53 additions and 25 deletions
|
|
@ -14,7 +14,7 @@ import (
|
|||
"text/template"
|
||||
)
|
||||
|
||||
// testEnv excludes GOGCTRACE from the environment
|
||||
// testEnv excludes GODEBUG from the environment
|
||||
// to prevent its output from breaking tests that
|
||||
// are trying to parse other command output.
|
||||
func testEnv(cmd *exec.Cmd) *exec.Cmd {
|
||||
|
|
@ -22,7 +22,7 @@ func testEnv(cmd *exec.Cmd) *exec.Cmd {
|
|||
panic("environment already set")
|
||||
}
|
||||
for _, env := range os.Environ() {
|
||||
if strings.HasPrefix(env, "GOGCTRACE=") {
|
||||
if strings.HasPrefix(env, "GODEBUG=") {
|
||||
continue
|
||||
}
|
||||
cmd.Env = append(cmd.Env, env)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue