The term 'go' is not recognized as the name of a cmdlet, function, script file, or operable program

戏子无情 提交于 2019-12-08 03:56:32

问题


After running...

go run main.go

I get this error

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

回答1:


SOLVED: Go to visual studio code (assuming this is installed) ctrl + shift + p to open command window type

Go: current GOPATH

this should give you a path create a system environment variable named GOPATH and add that path into that variable.

Make sure the system environment variables are set to:

GOPATH is set (in my case) to C:\Users[username]\go

GOROOT is set to C:\go\

IDE is Visual Studio Code.



来源:https://stackoverflow.com/questions/48602324/the-term-go-is-not-recognized-as-the-name-of-a-cmdlet-function-script-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!