go env and go help environment show the variables that matter to building Go programs. The ones listed here matter to running Go programs and are documented in 'go doc runtime'. We should not confuse matters by expanding the go command to document things that don't have to do with the go command.
4条答案
按热度按时间3phpmpom1#
GOGC
,GOMAXPROCS
和GOTRACEBACK
也没有文档记录。了解这一点后,我找到了 #37004 。更新了标题和描述,以便更容易找到这个问题。很不方便的是,没有一个地方可以显示所有的环境变量。也许
go env
可以被修改以显示它们。zbdgwd5y2#
go env and go help environment show the variables that matter to building Go programs.
The ones listed here matter to running Go programs and are documented in 'go doc runtime'.
We should not confuse matters by expanding the go command to document things that don't have to do with the go command.
3df52oht3#
我认为事情已经相当混乱了。例如,
GODEBUG
影响go
命令和运行时。它在go help environment
输出中显示如下:所以它提到了运行时,但没有说明它如何影响
go
命令。此外,即使将GODEBUG
设置为影响go
命令的内容(例如,export GODEBUG=gocacheverify=1
),它也不会将其添加到go env
输出中,而go env GODEBUG
什么都不打印。cig3rfwq4#
/cc @bcmills@matloob