- Download git binary: https://git-scm.com/download/win
- Keep everything default is fine.
-
Go to https://golang.org/dl and download the windows installer.
-
Next. Next. Next...
-
Now fire up git bash / cmd, type the following:
$ go version go version go1.4.2 windows/amd64
-
If your output is something like the above, done!
GOPATH is where your go projects and libraries resides. Choose wisely :D
- Make a new folder in an accessible location, take note of the paths.
- Right click
My Computer
->Perperties
- Choose
Advanced system settings
- Open
Envionment Variables...
- Under User variables, click
New...
Variable name
:GOPATH
Variable value
: The folder chosen in step 1. Mine isC:\Users\patat_000\go
.
It enable you to invoke go binary everywhere.
-
At step 4 of Set up GOPATH, look for a environment variable named
PATH
. If there are none, create one. -
Edit and append the following to the end of the value (don't delete existing value!):
;<YOUR GOPATH HERE>\bin
Taking the previous example, mine would be like
;C:\Users\patat_000\go\bin
See https://golang.org/doc/install#tarball
Of course you can also consult your distro packages...
$ mkdir $HOME/go
Now edit your $HOME/.profile
to include the following lines:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
NOTE: if you are not using bash, the file to edit might be different.
See https://golang.org/doc/install#osx
If you have installed Homebrew:
$ brew install go
$ mkdir $HOME/go
Now edit your $HOME/.profile
to include the following lines:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
NOTE: if you are not using terminal, the file to edit might be different. NOTE NOTE: same instructions as Linux's one :P