Skip to content

Commit 995d0f1

Browse files
fix: Use include=all param in go.dev downloads API for checksum validation (#1922)
The go.dev/dl/?mode=json endpoint only returns the two most recent Go minor versions. This causes checksum validation to fail for older supported Go versions that are no longer listed in the default response. Adding include=all ensures checksums are available for all Go versions.
1 parent 52f69d6 commit 995d0f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

projects/golang/go/scripts/get_upstream_golang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function build::go::download {
3939
local filename="$outputDir/${arch}/$version.${arch/\//-}.tar.gz"
4040
if [ ! -f $filename ]; then
4141
curl -sSLf --retry 5 "https://go.dev/dl/$version.${arch/\//-}.tar.gz" -o $filename --create-dirs
42-
sha256sum=$(curl -sSLf --retry 5 "https://go.dev/dl/?mode=json" | jq -r --arg tar "$version.${arch/\//-}.tar.gz" '.[].files[] | if .filename == $tar then .sha256 else "" end' | xargs)
42+
sha256sum=$(curl -sSLf --retry 5 "https://go.dev/dl/?mode=json&include=all" | jq -r --arg tar "$version.${arch/\//-}.tar.gz" '.[].files[] | if .filename == $tar then .sha256 else "" end' | xargs)
4343

4444
if [[ $(sha256sum ${filename} | cut -d ' ' -f1) != "${sha256sum}" ]]; then
4545
echo "CHECKSUMs don't match"

0 commit comments

Comments
 (0)