A bash script for installing a specific Go version on Linux (AMD64).
Expects a numeric version as a parameter (e.g. 1.21.1).
Simplified:
architecture=$(dpkg --print-architecture)
file_name="go${version}.linux-${architecture}.tar.gz"
wget https://go.dev/dl/${file_name}"
rm -rf /usr/local/go && tar -C /usr/local -xzf ${file_name}
Write to ~/.profile
export PATH=$PATH:/usr/local/go/bin
No comments:
Post a Comment