Docs menu
Runtime versions
Which Go versions Primcloud installs, how to pin one via the go directive or the // +heroku goVersion build directive, and how to upgrade.
On this page
Primcloud installs the Go version your go.mod asks for. Every module already has a go line, so most apps need no extra setup.
Supported versions#
The Go versions you can install are part of the Primcloud Runtime, and new Go releases are added to it after the Go project ships them. Each deployment's build log shows the exact version it installed.
The Go team supports the two newest major releases under its release policy. Older ones still build while they're available but get no fixes, so stay on a current one.
Pinning a version#
The first of these that applies decides:
1. // +heroku goVersion build directive: the most explicit. Add a comment line to go.mod:
module example.com/myapp
// +heroku goVersion =1.26.5
go 1.25
The value accepts standard semver constraints: =, ^, ~, >, <, or a bare version. =1.26.5 pins that exact patch; ^1.26 picks the latest 1.26.x; a bare 1.26 behaves like ^1.26.
2. The go line, when there's no +heroku goVersion. It installs the newest release of that version:
module example.com/myapp
go 1.26
That installs the newest 1.26.x. go 1.26.0 installs exactly 1.26.0.
Upgrading#
Change the version, commit, and push:
// +heroku goVersion: edit the constraint, commit, push.godirective: edit the value (go 1.25→go 1.26, say), commit, push.
The first build on a new version takes a little longer while it's downloaded.
Bumping the go directive also raises your app's declared minimum Go version, which module consumers see. Bumping only // +heroku goVersion changes what Primcloud builds with, without touching the module's declared minimum.
Read Go's release notes before jumping majors. A newer SDK can surface compile errors in code that built fine on the old one.
When a version is removed#
Older Go versions are eventually removed from the Primcloud Runtime. Until then, builds on them keep working. Once one is removed, builds that ask for it fail with "Couldn't resolve go version", and loosening the constraint within that version won't help. Move to a current version before then to avoid an upgrade under pressure.