App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
When you give App Platform access to your code, it defaults to using a Dockerfile if one is present in the root of the directory or specified in the app spec. Otherwise, App Platform checks your code to determine what language or framework it uses. If it supports the language or framework, it chooses an appropriate resource type and uses the proper buildpack to build the app and deploy a container.
App Platform looks for any of the following files to detect a Go application:
If App Platform detects one of these files, it guides you through the remaining configuration and then builds the app with the appropriate buildpack.
App Platform uses the heroku-buildpack-go buildpack for detecting and building Golang applications.
App Platform automatically uses the Go version specified in your
module github.com/digitalocean/sample-golang go 1.16 ...
Go apps that do not use a supported package manager may fail to build.
App Platform supports the following package managers: Go modules, dep, Godep, govendor, and Glide.
Go apps with dependencies in private git repos may fail to build.
The instructions in Heroku’s documentation for configuring authentication with private git repos for their Go buildpack will also work in App Platform. Alternatively, you can vendor the dependencies into the repository.
If your Go app uses private dependencies that are not accessible with the same account used to access the apps, you can inject a personal access token by setting the value of the
GO_GIT_CRED__HTTPS__GITHUB__COM environment variable to your GitHub personal access token. Learn more in Heroku’s documentation on private git repository credentials.