This page describes how to install and use the bundled services with the Go 1.12+ runtime for App Engine standard environment. Your app can access the bundled services through the App Engine services SDK for Go 1.12+.
Before you begin
- For the full list of legacy bundled services APIs available for Go 1.12+, see the legacy bundled services API references documentation.
- Before starting a migration project to Go 1.12+, see the runtime migration overview and migration considerations when using legacy bundled services.
Installing the App Engine services SDK
In order to call the legacy bundled services APIs with Go 1.12+, you must use the latest SDK. Follow these steps:
app.yamlfile to include the following line:
Add a reference to the latest SDK in your
go.modfile by running
go getin the terminal as follows:
go get google.golang.org/appengine/v2
The main difference when upgrading to Go 1.12+ is using v2 of the App Engine services SDK.
In your app, modify your import statements by inserting
/v2/in the old package names. For example, if using Memcache, do the following:
import ( "google.golang.org/appengine/v2" "google.golang.org/appengine/v2/memcache" )
For the full list of available package names, see the legacy bundled services API references documentation.
go mod tidyto clean up references in your
go mod tidy
You should be aware of the following considerations if you are migrating to the Go 1.12+ runtime and your app uses legacy bundled services:
- To test the legacy bundled services functionality in your Go 1.12+ app,
run your application in your local environment
with the development tools that you usually use, such as
- To deploy your app, use the
gcloud app deploycommand.