Reputation: 6168
Trying to get started with Go but I cant manage to set up the work environnement properly.
Upvotes: 14
Views: 50070
Reputation: 21
There could be possibility that you have not installed the correct exe folder. for windows download the windows-Version.msi, In my case i previously installed amd processor exe file. hence it was not running.
Upvotes: 1
Reputation: 1086
You need to set path var like from C:\Users\YourUser\go
to C:\Users\YourUser\
then you can see your go version in your command line go version
Upvotes: 0
Reputation: 11
If you are not able to solve the problem even after adding environment variables, you can check if you have installed Go extension from VSCode, install it if you haven't already. Then, when you create a new GO file to work in the working directory, "gopls command not available" will be popped up,click install all to get full support inside VSCode. I solved the issue like this, I hope that helps.
Upvotes: 1
Reputation: 57
I read various answers as well articles and most effective steps that helped me were :
Upvotes: 1
Reputation: 263
here's what made it work for me, assuming you hadnt change anything from a fresh GO install in windows 10.
set GOROOT in user variables: C:\Go\
add path in user variables: %USERPROFILE%\Go\bin
add path in system variables: C:\Go\bin
Upvotes: 3
Reputation: 844
Aside from @Xeph's answer, just make sure if you recently installed Go that you use a fresh terminal/cmd window.
Upvotes: 12
Reputation: 41
Run command "go env" and check the path for variable "gopath" that's where you should keep your project. Else where if you run go command you will get error "go is not recognized as internal or external command"
Upvotes: 4
Reputation: 484
EDITED for future reference.
You set your 'GOROOT' wrong. Set it to C:\Go\
Include C:\Go\bin to your 'Path'
Upvotes: 12