Skip to content

Instantly share code, notes, and snippets.

@mavjs
Last active May 31, 2022 18:30
Show Gist options
  • Select an option

  • Save mavjs/d6e8cc5f16cd8f55b62595e5e0723b6c to your computer and use it in GitHub Desktop.

Select an option

Save mavjs/d6e8cc5f16cd8f55b62595e5e0723b6c to your computer and use it in GitHub Desktop.
Golang related cli command notes

About

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment