Last active
March 16, 2022 02:13
-
-
Save dereknex/447b3cc5cdddf6981ea0e5a429209238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| case $(uname -m) in | |
| aarch64) ARCH=arm64;; | |
| armv7l) ARCH=arm;; | |
| *) ARCH=$(uname -m);; | |
| esac | |
| echo 'Please input golang version:' | |
| read VER | |
| echo 'Remove old go files.' | |
| sudo rm -rf /usr/local/go | |
| curl -sL https://dl.google.com/go/go${VER}.linux-${ARCH}.tar.gz -o /tmp/go.tar.gz | |
| sudo tar -xzf /tmp/go.tar.gz -C /usr/local/ | |
| rm /tmp/go.tar.gz | |
| echo 'All done!' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment