PS D:…> go env
go : 無(wú)法將“go”項(xiàng)識(shí)別為 cmdlet、函數(shù)、腳本文件或可運(yùn)行程序的名稱(chēng)。請(qǐng)檢查名稱(chēng)的拼寫(xiě),如果包括路徑,請(qǐng)確保路徑正確,然后再試一次。
所在位置 行:1 字符: 1
- go env
- ~~
- CategoryInfo : ObjectNotFound: (go:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
原因分析
Go 安裝路徑發(fā)生變化。
解決方案
在 Visual Studio Code 終端(PowerShell實(shí)例)中運(yùn)行以下命令,使當(dāng)前的PowerShell實(shí)例從計(jì)算機(jī)加載最新的路徑變量。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-525333.html
$env:Path = [System.Environment]::GetEnvironmentVariable(“Path”,“Machine”)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-525333.html
到了這里,關(guān)于Go常見(jiàn)問(wèn)題(一)Visual Studio Code 無(wú)法識(shí)別 go 指令的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!