2021-02-15 20:52:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-11-26 09:11:14 +00:00
|
|
|
BASEURL=https://go.dev/dl/
|
2021-02-15 20:52:43 +00:00
|
|
|
VERSION=${1:-}
|
|
|
|
|
|
|
|
if [[ -z $VERSION ]]
|
|
|
|
then
|
|
|
|
echo "No version supplied"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
curl -s "${BASEURL}?mode=json&include=all" | \
|
|
|
|
jq '.[] | select(.version == "go'${VERSION}'")' | \
|
|
|
|
jq -r '.files[] | select(.kind == "archive" and (.os == "linux" or .os == "darwin")) | (.os + "-" + .arch + " = \"" + .sha256 + "\";")'
|