fix(ci): enable GOEXPERIMENT=cacheprog dynamically only on Go < 1.24
All checks were successful
Go CI with S3 Caching / build-and-test (push) Successful in 1m14s

This commit is contained in:
2026-05-19 21:58:26 -07:00
parent 852e030b54
commit 385520e2bb

View File

@@ -76,8 +76,15 @@ runs:
echo "Configuring GOCACHEPROG: $CMD"
echo "GOCACHEPROG=$CMD" >> "$GITHUB_ENV"
# Ensure GOEXPERIMENT=cacheprog is enabled for Go 1.21-1.23 compatibility
echo "GOEXPERIMENT=cacheprog" >> "$GITHUB_ENV"
# Ensure GOEXPERIMENT=cacheprog is enabled ONLY for Go 1.21-1.23 compatibility
GO_VER=$(go env GOVERSION | grep -oE '[0-9]+\.[0-9]+' | head -n 1)
echo "Detected Go version: $GO_VER"
if [ "$GO_VER" = "1.21" ] || [ "$GO_VER" = "1.22" ] || [ "$GO_VER" = "1.23" ]; then
echo "Enabling GOEXPERIMENT=cacheprog for compatibility"
echo "GOEXPERIMENT=cacheprog" >> "$GITHUB_ENV"
else
echo "GOEXPERIMENT=cacheprog is not needed or supported in Go 1.24+"
fi
# Diagnose secret population
echo "Diagnosing secrets..."