86f042a55b
GitOrigin-RevId: c7d0dbe094c988209edac801eb2a0cc21aa498d8
15 lines
402 B
Bash
Executable file
15 lines
402 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
BASEURL=https://golang.org/dl/
|
|
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 + "\";")'
|