GOENV 只能使用 OS 环境设置

GOENV can only be set using the OS environment

我想设置GOENV路径,使用下面的命令go env -w GOENV=D:\go\env,可是他returnsgo env -w: GOENV can only be set using the OS environment我应该怎么设置GOENV自定义路径呢?电脑windows11

的环境

你在用什么shell? cmd.exe 或幂shell ?

在cmd.exe中:

set GOENV=D:\go\env

掌权shell :

$env:GOENV="D:\go\env"