[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-20。"],[[["\u003cp\u003eThis guide outlines the process of installing and utilizing the App Engine services SDK for Go, enabling access to legacy bundled services within the App Engine standard environment.\u003c/p\u003e\n"],["\u003cp\u003eTo begin, you must update your \u003ccode\u003eapp.yaml\u003c/code\u003e file to include \u003ccode\u003eapp_engine_apis: true\u003c/code\u003e and ensure you are using the latest SDK by referencing \u003ccode\u003egoogle.golang.org/appengine/v2\u003c/code\u003e in your \u003ccode\u003ego.mod\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eWhen updating from older SDK versions, the key change is the inclusion of \u003ccode\u003e/v2/\u003c/code\u003e in import statements within your Go application code, such as \u003ccode\u003egoogle.golang.org/appengine/v2/memcache\u003c/code\u003e for Memcache.\u003c/p\u003e\n"],["\u003cp\u003eBefore beginning migration to Go, be sure to review the runtime migration overview and make yourself aware of the migration considerations.\u003c/p\u003e\n"],["\u003cp\u003eTesting of legacy bundled services in a Go application can be performed locally using tools like \u003ccode\u003ego run\u003c/code\u003e, and deployment is achieved using the \u003ccode\u003egcloud app deploy\u003c/code\u003e command.\u003c/p\u003e\n"]]],[],null,["# Access legacy bundled services for Go\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nThis page describes how to install and use the bundled\nservices with the [Go runtime](/appengine/docs/standard/go/runtime)\nfor App Engine standard environment. Your app can access the bundled services\nthrough the **App Engine services SDK for Go**.\n\nBefore you begin\n----------------\n\n- Refer to the [list of legacy bundled services APIs](/appengine/docs/standard/services/overview) you can call in the Go runtime.\n- Before starting a migration project to Go, see the [runtime migration overview](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) and [migration considerations](#migration) when using legacy bundled services.\n\nInstalling the App Engine services SDK\n--------------------------------------\n\nIn order to call the legacy bundled services APIs with Go, you\nmust use the latest SDK. Follow these steps:\n\n1. Update your [`app.yaml`](/appengine/docs/standard/reference/app-yaml#app_engine_apis)\n file to include the following line:\n\n app_engine_apis: true\n\n2. Add a reference to the latest SDK in your `go.mod` file by running `go get`\n in the terminal as follows:\n\n go get google.golang.org/appengine/v2\n\n The main difference when upgrading to Go is using v2 of the App Engine services SDK.\n3. In your app, modify your import statements by inserting `/v2/` in the old\n package names. For example, if using Memcache, do the following:\n\n import (\n \"google.golang.org/appengine/v2\"\n \"google.golang.org/appengine/v2/memcache\"\n )\n\n For the full list of available package names, see the\n [legacy bundled services API references documentation](/appengine/docs/standard/go/reference/services/bundled/latest).\n4. Run `go mod tidy` to clean up references in your `go.mod` file.\n\n go mod tidy\n\n| **Note:** When upgrading to a new major version of a Go dependency, such as a package or library, make sure to include the major version number of the dependency in your import statements. If you run `go mod tidy` and find that it is still importing an older version of the App Engine services SDK for Go, you have probably missed upgrading an import statement.\n\nMigration considerations\n------------------------\n\nYou should be aware of the following considerations if you are migrating to\nthe Go runtime and your app uses legacy bundled services:\n\n- To test the legacy bundled services functionality in your Go app, [run your application in your local environment](/appengine/docs/standard/testing-and-deploying-your-app#running_locally) with the development tools that you usually use, such as `go run`.\n- To deploy your app, use the [`gcloud app deploy`](/appengine/docs/standard/go/building-app#deploying_your_web_service_on) command."]]