This is a creation in Article, where the information may have evolved or changed. Mac native is the first brew install go 1.3.3 version, this January through brew upgrade to version 1.4.
But the official update for brew is too slow to wait to manually upgrade to version 1.5.1.
1. Download go1.5.1.darwin-amd64.tar.gz from official website https://golang.org/dl/
Cd/users/wenke/documents/tools/go
Mv/users/wenke/downloads/go1.5.1.darwin-amd64.tar.gz./
Tar zxvf go1.5.1.darwin-amd64.tar.gz
Xattr-r-C Go
MV Go 1.5.1
2. Modify the Liteide configuration file:
Goroot=/usr/local/cellar/go/1.4/libexec
Become:
goroot=/users/wenke/documents/tools/go/1.5.1
3. Modifying a hard-link file
Go version
Go version go1.4 darwin/amd64
5. Delete the files generated by the old version compilation
RM-RF $GOPATH/pkg
TIP:
If you have finished upgrading, compile or run the old project error:
Go Build
Package Ysz
Imports Runtime:c source files not allowed when not using CGO or swig:atomic_amd64x.c defs.c float.c heapdump.c lfstack. C malloc.c mcache.c mcentral.c mem_darwin.c mfixalloc.c mgc0.c mheap.c msize.c os_darwin.c panic.c parfor.c proc.c Runtime . C signal.c signal_amd64x.c signal_unix.c stack.c string.c sys_x86.c
This is why the environment variable is not in effect. Only source. ZSHRC or new terminal can be solved!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.