If your $GOROOT
is in ~/goroot
and your $GOPATH
is in ~/go
, you want to make sure that your new go version goes to the right folder.
By default the go tar file will unpack with go/
as a prefix directory, thus we want to remove that when unpacking, thus the --strip-components=1
.
tar -C ~/goroot -xzvf go$VERSION.linux-amd64.tar.gz --strip-components=1