My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/development/compilers/go/print-hashes.sh

15 lines
398 B

#!/usr/bin/env bash
set -euo pipefail
BASEURL=https://go.dev/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 + "\";")'