Access legacy bundled services for Go

This page describes how to install and use the bundled services with the Go runtime for App Engine standard environment. Your app can access the bundled services through the App Engine services SDK for Go.

Before you begin

Installing the App Engine services SDK

In order to call the legacy bundled services APIs with Go, you must use the latest SDK. Follow these steps:

  1. Update your app.yaml file to include the following line:

    app_engine_apis: true
    
  2. Add a reference to the latest SDK in your go.mod file by running go get in the terminal as follows:

    go get google.golang.org/appengine/v2
    

    The main difference when upgrading to Go is using v2 of the App Engine services SDK.

  3. 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.

  4. Run go mod tidy to clean up references in your go.mod file.

    go mod tidy
    

Migration considerations

You should be aware of the following considerations if you are migrating to the Go runtime and your app uses legacy bundled services: