Your app has a GOPACKAGENAME environment variable specified and has any files ending with .go.

Your app has a glide.yml file and is using glide, starting in buildpack version 1.7.9.

Your app has a Gopkg.toml file and is using dep, starting in buildpack version 1.8.9.

If your Cloud Foundry deployment does not have the Go Buildpack installed, or the installed version is out of date, you can use the latest version with the command:

$ cf push my_app -b https://github.com/cloudfoundry/go-buildpack.git

When specifying versions, specify only major/minor versions, such as Go 1.6, rather than Go 1.6.0. This ensures you receive the most recent patches.

Start Command

When pushing Go apps, you can specify a start command for the app. You can place the start command in the Procfile file in root directory of your app. For example, if the binary generated by your Go project is my-go-server, your Procfile could contain the following:

Go 1.6

Push an App with Glide

If you use glide to specify or package your dependencies,
make sure that you have created a valid glide.yml file in the root directory of your app by running glide init.

To vendor your dependencies before pushing, run glide install.
This will generate a vendor directory and a glide.lock file specifying the latest compatible versions of your dependencies.
You must have a glide.lock file when pushing a vendored app. You do not need a glide.lock file when deploying a non-vendored app.

Push an App with dep

If you use dep to specify or package your dependencies,
make sure that you have created a valid Gopkg.toml file in the root directory of your app by running dep init.

To vendor your dependencies before pushing, run dep ensure.
This will generate a vendor directory and a Gopkg.lock file specifying the latest compatible versions of your dependencies.
You must have a Gopkg.lock file when pushing a vendored app. You do not need a Gopkg.lock file when deploying a non-vendored app.

Pass a Symbol and String to the Linker

The Go buildpack supports the Go linker’s ability, -X symbol value,
to set the value of a string at link time.
Set the GO_LINKER_SYMBOL and GO_LINKER_VALUE in the application’s configuration before pushing code.

This can be used to embed the commit SHA or other build-specific data directly
into the compiled executable.

C Dependencies

The Go buildpack supports building with C dependencies using cgo. You can set config vars to specify cgo flags
to, for example, specify paths for vendored dependencies. As an example, to build gopgsqldriver,
add the config var CGO_CFLAGS with the value -I/app/code/vendor/include/postgresql
and include the relevant Postgres header files in vendor/include/postgresql/ in your app.

Proxy Support

If you need to use a proxy to download dependencies during staging, you can set
the http_proxy and/or https_proxy environment variables. For more information, see the Proxy Usage topic.