I'm just starting with Go, so of course I stumble on errors on every corner. Well not really, it's way better then when I started with Java. But there is one issue.
I'm using GoLand IDE from JetBrains, and within it's integrated terminal I can easily use go
command.
go version // Output: go version go1.17.5 windows/amd64
But when I try the same in GitBash the response is bash: go: command not found
.
Where to find the executable?
CodePudding user response:
I remembered that I have the best File Search application there is for Windows and just typed in go.exe
.
The file was promptly and obviously found just where I had saved it when starting my first project, that is in C:\Users\MY_USERNAME\sdk\go1.17.5\bin\
which is exactly what I needed to save in the PATH variable.
So for those who don't know:
- press "Win" key
- type "env"
- select "Edit the system environment variables"
- select "Environment Variables"
- double-click "Path" in the list below "System variables"
- select "New"
- paste the whole path of the directory where you have found
go.exe
in (in my case "C:\Users\MY_USERNAME\sdk\go1.17.5\bin\go.exe" or "%userprofile%\sdk\go1.17.5\bin" for short and exportable) - click "OK" a few times :)