'Golang: Getting started - "go" is not recognized as an internal or external command"

Trying to get started with Go but I cant manage to set up the work environnement properly.



Solution 1:[1]

Aside from @Xeph's answer, just make sure if you recently installed Go that you use a fresh terminal/cmd window.

Solution 2:[2]

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"

Solution 3:[3]

here's what made it work for me, assuming you hadnt change anything from a fresh GO install in windows 10.

  1. set GOROOT in user variables: C:\Go\

  2. add path in user variables: %USERPROFILE%\Go\bin

  3. add path in system variables: C:\Go\bin

Solution 4:[4]

I read various answers as well articles and most effective steps that helped me were :

  1. My Computer -> RC -> Properties
  2. Advanced System Settings -> Environment Variables
  3. Under System Variables Section -> New -> GOPATH -> Project Location
  4. Select Path -> New ->path to bin of installed go
  5. Save and close.
  6. Restart the cmd / system .
  7. Run go in the cmd to check the working .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nth.gol
Solution 2 Garima
Solution 3 user3366943
Solution 4 remote007