mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
cf69b3e801
This mirrors what Rust does and allows us to drop go1.4 from the process.
16 lines
402 B
Bash
Executable File
16 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 + "\";")'
|