The installation

  1. xcode-select –install
  2. The/usr/bin/ruby – e “$(curl – fsSL raw.githubusercontent.com/Homebrew/in…). “
  3. brew install go
  4. $Go version go version go1.10 Darwin/AMd64

The environment adds the following export statement to.bash_profile:

vim ~/.bash_profile export GOPATH=
H O M E / g o e x p o r t P A T H = HOME/go export PATH=
PATH:$GOPATH/bin

Go assumes that your workspace contains a specific directory structure. Go puts files in three directories: all source code in SRC, package objects in PKG, and compiled programs in bin. You can create directories in the following way.

mkdir -p
G O P A T H / s r c GOPATH/src
GOPATH/pkg $GOPATH/bin

In this case, you can use Go Get, which will install the downloaded resources in the appropriate $GOPATH/ XXX directory as SRC/PKG /bin.

Get the from studygolang. Gitbook. IO/learn – go – wi…