The Go buildpack will detect your that build is Go, if you are using go modules, dep, govendor, glide, GB, or Godep. If detected, the dependencies will be installed and the source compiled.
Sample Go Procfile
Because Go builds produce a single binary, Railway knows how to serve the resulting build without a Procfile.
Setting Go Version
Nixpacks and Paketo buildpacks will detect the version from standard go.mod.
Heroku buildpacks, you must add the following to your go.mod, right above your go version
// +heroku goVersion go1.18
Edit this file on GitHub