Go

The Go programming language is supported.

Go Versions

Availability

The following versions of Go are available:

Go Version scalingo-20 scalingo-22
go1.24 up to 1.24.0 up to 1.24.0
go1.23 up to 1.23.6 up to 1.23.6
go1.22 up to 1.22.12 up to 1.22.12
go1.21 up to 1.21.13 up to 1.21.13
go1.20 up to 1.20.14 up to 1.20.14

The default Go version on both scalingo-20 and scalingo-22 is the latest go1.20 version.

Dependencies Installation

Scalingo installs the dependencies Go application using Go Modules.

Private Dependencies

Here is how to use a dependency in a private repository for your application.

The platform looks for environment variables that follow the following pattern: GO_GIT_CRED__<PROTOCOL>__<HOSTNAME>. Any periods (.) in the HOSTNAME must be replaces with double underscores (__).

The value of a matching var will be used as the username. If the value contains a “:”, the value will be split on the “:” and the left side will be used as the username and the right side used as the password. When no password is present, x-oauth-basic is used.

The following example will cause git to use the FakePersonalAccessTokenHere as the username when authenticating to github.com via https:

$ scalingo env-set GO_GIT_CRED__HTTPS__GITHUB__COM=FakePersoalAccessTokenHere

Defining a Procfile

web: <base package name>

Example if your package is github.com/user/example:

web: example

Pre/Post Compile Hooks

If the file bin/go-pre-compile exists and is executable, it will be executed before compilation.

Likewise, if the file bin/go-post-compile exists and is executable, it will be executed after the compilation.

Because the buildpack installs compiled executables to bin, the go-post-compile hook can be written in Go if it’s installed by the specified <packagespec>.

Buildpack

More information at https://github.com/Scalingo/go-buildpack.


Suggest edits

Go

©2025 Scalingo