No runway-specific setup is required for most Go programs. A simple example is available at https://github.com/hostwithquantum/runway-example-go.
Runway sets the environment variable PORT
, which is the port that your server
should listen on.
If your repo contains multiple programs, you may have to set BP_GO_TARGETS
.
The first target will be used as the main command for your app, any other
will be compiled and included in the image:
$ runway app config set BP_GO_TARGETS=./cmd/web-server:./cmd/some-debugging-programs
go generate
You can instruct Runway to add a go generate ./...
step before the build via
$ runway app config set BP_GO_GENERATE=true
Since this runs after installing the dependencies, you can use
the usual Go idioms to install any tools
that your //go:generate
step might use.