1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p curl jq
3 # shellcheck shell=bash
6 BASEURL
=https
://go.dev
/dl
/
9 if [[ -z ${VERSION} ]]; then
10 echo "No version supplied"
14 curl
-s "${BASEURL}?mode=json&include=all" |
15 jq
'.[] | select(.version == "go'"${VERSION}"'")' |
16 jq
-r '.files[] | select(.kind == "archive" and (.os == "linux" or .os == "darwin" or .os == "freebsd")) | (.os + "-" + .arch + " = \"" + .sha256 + "\";")'