GOENV can only be set using the OS environment

Issue

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

Solution

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

In cmd.exe :

set GOENV=D:\go\env

In Powershell :

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

Answered By – LeGEC

Answer Checked By – Pedro (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.