Suddenly want to go to the pit, and then try to on the company's new Mac on the toss
installation
by executing a command
Brew Search Go
See available The latest version is 1.7, it's him.
Brew install [email protected]
installed, follow the online tutorial directly in the terminal to perform go, the results prompt command does not exist Orz. All right, add your own name.
Open a. Bash_profile and add:
Alias go= '/usr/local/cellar/go\@1.7/1.7.6/bin/go '
Executes the source. Bash_profile, and then executes go. All normal ~
Follow the tutorials, and then continue to set several environment variables in. Bash_profile:
Export goroot=/usr/local/opt/go\@1.7/bin/
Export gopath=~/code/golang/# This is my project path
Export gobin= $GOPATH/bin
Export path=GOBIN
Then execute go ENV
Goarch= "AMD64"
Gobin= "/users/atai/code/golang//bin"
Goexe= ""
Gohostarch= "AMD64"
Gohostos= "Darwin"
Goos= "Darwin"
Gopath= "/users/atai/code/golang/"
Gorace= ""
goroot= "/usr/local/opt/[email Protected]/bin"
Gotooldir= "/usr/local/opt/[email protected]/bin/pkg/tool/darwin_amd64"
Cc= "Clang"
Gogccflags= "-fpic-m64-pthread-fno-caret-diagnostics-qunused-arguments-fmessage-length=0-fdebug-prefix-map=/var /folders/37/4py2jv5d4pvcf61kz4tf7q800000gn/t/go-build735656329=/tmp/go-build-gno-record-gcc-switches- Fno-common "
cxx= "clang++"
cgo_enabled= "1"
Perfect (old??????) Old
IDE
Jetbrain IDE is accustomed to, so go directly to the official website to download and install the Gogland. Rare free (??????)??
Open Gogland wrote Hello World ready to run, the results prompted to set the next goroot in the IDE. OK, after you open the pop-up window of the selection directory, press command+shift+g, enter/usr/local/cellar/[email Protected]/1.7.6,open, and then the 1.7 version of Go will appear.
Well, the rest is the start.
Use Brew to install and use Golang under Mac