Last active
March 11, 2023 11:14
-
-
Save giseongeom/418b2bcf8d5ad1d8d76c9443fc945af1 to your computer and use it in GitHub Desktop.
Download latest golang (linux-amd64)
This file contains 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
#!/usr/bin/env bash | |
set -e | |
if [ "$(id -u)" -ne 0 ]; then | |
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' | |
exit 1 | |
fi | |
# go1.19.linux-amd64.tar.gz | |
export GO_DOWNLOAD_FILE=$(curl -L -Ss https://go.dev/dl/\?mode\=json | jq -r '.[0].files[] | select(.arch == "amd64") | select(.os == "linux") | .filename') | |
export GO_DOWNLOAD_URL="https://go.dev/dl/${GO_DOWNLOAD_FILE}" | |
curl -Ss -L -o /tmp/golang.tgz ${GO_DOWNLOAD_URL} \ | |
&& tar zxf /tmp/golang.tgz -C /usr/local \ | |
&& /usr/local/go/bin/go version \ | |
&& echo "golang Installation is Done!" && echo '' | |
Author
giseongeom
commented
Mar 11, 2023
- Windows 환경에서 최신버전 정보를 구하려면
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment