{"record":{"id":"f256379b77beb3d3","repo":"golang/go","slug":"no-releases-found-for-go-v","errorCode":null,"errorMessage":"no releases found for go >= %v","messagePattern":"no releases found for go >= (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/toolchain/switch.go","lineNumber":231,"sourceCode":"\tlatest := \"\"\n\tfor i := len(list) - 1; i >= 0; i-- {\n\t\tv := list[i]\n\t\tif gover.Compare(v, need) < 0 {\n\t\t\tbreak\n\t\t}\n\t\tif gover.Lang(latest) == gover.Lang(v) {\n\t\t\tcontinue\n\t\t}\n\t\tnewer := latest\n\t\tlatest = v\n\t\tif newer != \"\" && !gover.IsPrerelease(newer) {\n\t\t\t// latest is the last patch release of Go 1.X, and we saw a non-prerelease of Go 1.(X+1),\n\t\t\t// so latest is the one we want.\n\t\t\tbreak\n\t\t}\n\t}\n\tif latest == \"\" {\n\t\treturn \"\", fmt.Errorf(\"no releases found for go >= %v\", need)\n\t}\n\treturn \"go\" + latest, nil\n}\n\n// HasAuto reports whether the GOTOOLCHAIN setting allows \"auto\" upgrades.\nfunc HasAuto() bool {\n\tenv := cfg.Getenv(\"GOTOOLCHAIN\")\n\treturn env == \"auto\" || strings.HasSuffix(env, \"+auto\")\n}\n\n// HasPath reports whether the GOTOOLCHAIN setting allows \"path\" upgrades.\nfunc HasPath() bool {\n\tenv := cfg.Getenv(\"GOTOOLCHAIN\")\n\treturn env == \"path\" || strings.HasSuffix(env, \"+path\")\n}\n","sourceCodeStart":213,"sourceCodeEnd":247,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/toolchain/switch.go#L213-L247","documentation":"NewerToolchain enumerates available Go releases from the module proxy and local cache, sorted newest-to-oldest, and picks the latest patch release of the family below the newest family that meets the version floor. If no release in the list is >= the required version, this error is returned. It is a specific root cause that surfaces wrapped by error 1121.","triggerScenarios":"A module declares a go directive for a version that does not exist in any published release (future or typo); the proxy returned an empty list; GOPROXY=off with no cached toolchain modules; the version list was fetched but every entry was below the `need` threshold.","commonSituations":"go directive set to an unreleased version (e.g., `go 1.99`); typo in go directive; air-gapped environment with empty module cache; GOPROXY pointing to a mirror that hasn't synced the latest releases.","solutions":["Check the module's go.mod — the go directive may specify a version that doesn't exist yet","Ensure network access to GOPROXY so the release list can be fetched","Verify GOPROXY is not 'off': `go env GOPROXY`"],"exampleFix":"# before: go.mod requests a non-existent version\ngo 1.99\n\n# after: use a real released version\ngo 1.23\n\n# or override toolchain selection to local\nexport GOTOOLCHAIN=local","handlingStrategy":"fallback","validationCode":"# Check if the go directive references a real Go version\nGO_VER=$(grep '^go ' go.mod | awk '{print $2}')\necho \"go.mod requires Go $GO_VER\"\necho \"Latest available: see https://go.dev/dl/\"\n# If GO_VER doesn't exist, the build will fail","typeGuard":null,"tryCatchPattern":"# Fallback to local toolchain when no releases found\nif ! go build ./... 2>&1 | grep -q 'no releases found'; then\n  echo 'ok'\nelse\n  GOTOOLCHAIN=local go build ./...\nfi","preventionTips":["Verify the go directive in go.mod references a released Go version","Keep GOPROXY accessible or pre-cache toolchain modules","Set GOTOOLCHAIN=local when working offline"],"tags":["toolchain","version-management","network","gotoolchain"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}