Skip to content

Installing Go

NginProject edited this page Oct 6, 2018 · 1 revision

Windows

Download and run the installer found at http://golang.org/doc/install

Linux

Download the latest distribution:

`curl -O https://dl.google.com/go/go1.11.1.linux-amd64.tar.gz

Unpack it to the /usr/local (might require sudo)

`tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz

Set GOPATH and PATH

For Go to work properly, you need to set the following two environment variables:

# setup a go folder
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
# update your path
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
# read the environment variables into current session
source ~/.bashrc