I'm not sure if this an issue with go env or with go help environment, but the latter mentions the GODEBUG variable in the first section General purpose environment variables.
However go env -w GODEBUG=gctrace=1 returns an error.
Since, as far as I know, GODEBUG is not used by the go command, go help environment is probably wrong and GODEBUG should be removed.
It may be better, however, to move GODEBUG and the other runtime environment variable in a new section Runtime specific environment variables with the other variables GOGC, GOMAXPROCS, GORACE and GOTRACEBACK.
The text was updated successfully, but these errors were encountered:
This is an issue with go help environment. The documentation there currently does not distinguish between “environment variables processed by the go command” and “environment variables processed by programs built by the go command”, and it arguably should.
bcmills
changed the title
cmd/go: go env does not recognize runtime environment variables
cmd/go: distinguish between cmd/go variables and runtime variables in 'go help environment'
Feb 4, 2020
I have compared the variables listed in go help environment with KnowEnv in internal/cfg/cfg.go.
All the environment variables listed in go help environment are in KnowEnv, with the exception of GODEBUG and the variables listed in the section Special-purpose environment variables.
On the other hand, GOMOD is not listed in KnowEnv and GO111MODULE is not listed in go help environment.
There are 50 variables in KnowEnv and 49 variables in go help environment (excluding the special-purpose environment variables.
I think the Special-purpose section should remain, and a new section should be added to document the runtime environment variables.
In alternative, go help environment should add a note to see go doc runtime for additional environment variables.
I'm not sure if this an issue with
go env
or withgo help environment
, but the latter mentions theGODEBUG
variable in the first section General purpose environment variables.However
go env -w GODEBUG=gctrace=1
returns an error.Since, as far as I know,
GODEBUG
is not used by thego
command,go help environment
is probably wrong andGODEBUG
should be removed.It may be better, however, to move
GODEBUG
and the otherruntime
environment variable in a new section Runtime specific environment variables with the other variablesGOGC
,GOMAXPROCS
,GORACE
andGOTRACEBACK
.The text was updated successfully, but these errors were encountered: