问题背景

PowerShell是正常的,在VSCodeGoland的终端中执行go version报错:

go: The term 'go' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

解决方案

请尝试在VSCode终端中运行以下命令:

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")

它将使当前的PowerShell实例从计算机加载最新的PATH变量