GOENV can only be set using the OS environment

Viewed 306

I want to set the GOENV path and use the following command go env -w GOENV=D:\go\env, but he returns go env -w: GOENV can only be set using the OS environment how should I set the GOENV custom path?The computer environment of windows11

1 Answers

What shell are you using ? cmd.exe or Powershell ?

In cmd.exe :

set GOENV=D:\go\env

In Powershell :

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