how do i upgrade to latest version of go?

338 views
Skip to first unread message

JM

unread,
Apr 24, 2018, 6:57:10 PM4/24/18
to golang-nuts
I currently have on my mac:

go version go1.9 darwin/amd64


and want to upgrade to the latest.


Thanks.

Dave Cheney

unread,
Apr 24, 2018, 7:58:32 PM4/24/18
to golang-nuts
It depends on how you installed ypthe previous version of go. Home brew is popular on the Mac so follow their instructions for upgrading a package installed via brew.

If you used one of the options from the golang org website, simply remove /usr/local/go and follow the instruction on the website to install go 1.10.1.

Lastly, unset GOROOT if you’ve set it.

Lucas Simon Rodrigues Magalhaes

unread,
May 22, 2018, 7:29:59 PM5/22/18
to golang-nuts
Hi, I'm having trouble updating the version through source code.

export GOROOT_BOOTSTRAP=/home/lucas/go1.4
export GOROOT=$HOME/go
export GOPATH=$HOME/workspace-go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

$ go version
go version go1.8.3 linux/amd64

When i run ./all.bash 

$
./all.bash
Building Go cmd/dist using /home/lucas/go1.4.
Building Go toolchain1 using /home/lucas/go1.4.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
/home/lucas/go/src/cmd/go/zosarch.go:3:9: package cfg; expected main
go tool dist
: FAILED: /home/lucas/go/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-706454567/cmd/go/_go_.a -p main /home/lucas/go/src/cmd/go/alldocs.go /home/lucas/go/src/cmd/go/go11.go /home/lucas/go/src/cmd/go/main.go /home/lucas/go/src/cmd/go/zdefaultcc.go /home/lucas/go/src/cmd/go/zosarch.go: exit status

Tamás Gulácsi

unread,
May 23, 2018, 12:34:23 AM5/23/18
to golang-nuts
rm -rf ~/go/src
Then extract again.

karan singh

unread,
May 23, 2018, 8:49:01 AM5/23/18
to Tamás Gulácsi, golang-nuts
Reply all
Reply to author
Forward
0 new messages