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.
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.