Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / go / print-hashes.sh
blob97be7d189ad8adfc645f59eb1b494c92cd0a2caa
1 #!/usr/bin/env bash
2 set -euo pipefail
4 BASEURL=https://golang.org/dl/
5 VERSION=${1:-}
7 if [[ -z $VERSION ]]
8 then
9 echo "No version supplied"
10 exit -1
13 curl -s "${BASEURL}?mode=json&include=all" | \
14 jq '.[] | select(.version == "go'${VERSION}'")' | \
15 jq -r '.files[] | select(.kind == "archive" and (.os == "linux" or .os == "darwin")) | (.os + "-" + .arch + " = \"" + .sha256 + "\";")'