Phenomenon of the problem
PS D:\... > go env go: The "go" entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name, and if paths are included, make sure the path is correct, then try again. 1 + go env + ~~ + CategoryInfo: ObjectNotFound: (go:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundExceptionCopy the code
Cause analysis,
Go The installation path is changed.
The solution
Run the following command in the Visual Studio Code terminal (PowerShell instance) to make the current PowerShell instance load the latest path variable from the computer.
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
Copy the code