Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Shell - go command not found

I found this course on a website called Lynda.com (some of you probably know about this website).

The course was called: Code Clinic: Go. So, I'm using something called Go or Golang and I downloaded this command program called Git Shell, and whenever I execute a Go Command, I get this message:

bash: go : command not found

Does anybody know what's going on?

like image 209
Martin Schmidt Avatar asked Apr 26 '16 15:04

Martin Schmidt


3 Answers

You have to put the Go executable in your PATH:

1) cd ~

2) vi .bashrc

3) Inside .bashrc, enter the following: PATH=$PATH:/c/Go/bin

Restart git bash and you should now have the go command

like image 69
whyzhi Avatar answered Nov 02 '22 03:11

whyzhi


You need to set GOPATH environment variable with the path of your GO installation directory.

For example if your Go installation directory is C:\Go

Open a bash terminal and run the following:

GOPATH=/c/Go/bin

Then type go version to check if it works

you should see the go version you installed

like image 38
Prosp Avatar answered Nov 02 '22 01:11

Prosp


The Go compiler is not part of Git Bash; you need to install it separately.

See the download page on http://golang.org/; for Windows, one of the MSI installers is most likely to be appropriate.

like image 37
Charles Duffy Avatar answered Nov 02 '22 01:11

Charles Duffy