Go 1.11은 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Go 1.11 애플리케이션을 배포할 수 없습니다. 기존 Go 1.11 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 Go 버전으로 마이그레이션하는 것이 좋습니다.
Go 1.11 표준 런타임에서 실행되는 앱은 모든 linux/amd64 호환 패키지를 사용할 수 있습니다.
Go 모듈 사용
Go 모듈을 사용하여 Go 앱에서 종속 항목을 관리하는 것이 좋지만 Go 모듈로 마이그레이션할 준비가 되지 않았으면 이전 GOPATH를 계속 사용할 수 있습니다.
앱을 배포할 때 App Engine은 go build 명령어를 사용하여 앱을 빌드하므로 Go의 동작 자체와 일치합니다. 앱에 모듈 인식 모드가 사용되도록 하려면 개발 환경에서 다음을 수행합니다.
app.yaml 파일과 동일한 디렉터리에 모듈의 go.mod 파일을 만듭니다. App Engine은 현재 디렉터리를 검색한 후 go.mod 파일을 찾을 때까지 계속해서 그 다음 상위 디렉터리를 검색합니다.
App Engine이 go.mod 파일을 찾지 못하면 GOPATH 모드를 따릅니다.
GO111MODULE 환경 변수를 설정한 경우 변수 값이 모듈 인식 모드를 사용 설정했는지 확인합니다. 앱을 배포할 때 App Engine은 GO111MODULE 환경을 확인하고 Go 자체 동작을 찾습니다.
앱에 go.mod 파일이 포함되어 있으면 App Engine은 GO111MODULE 변수 설정만 적용합니다.
$GOPATH/src에 앱 디렉터리를 배치하지 마세요. 앱이 $GOPATH/src 디렉터리 트리에 있는 경우 App Engine은 앱에 go.mod 파일을 정의한 경우에도 GOPATH 모드를 따릅니다.
비공개 종속 항목 사용
App Engine은 빌드 프로세스 중 비공개 종속 항목을 다운로드할 수 없으므로 배포 시 애플리케이션 코드에 포함해야 합니다.
비공개 종속 항목을 선언하려면 go.mod 파일의 replace 지시문을 사용해야 합니다. 다음 예시에서는 앱이 /myapp/ 디렉터리에 있다고 가정합니다.
앱 디렉터리로 변경합니다.
cd /myapp
비공개 종속 항목이 포함된 디렉터리를 만듭니다.
mkdir private
비공개 종속 항목이 private 디렉터리에 있는지 확인합니다. 한 가지 방법은 심볼릭 링크를 만드는 것입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eApps in the Go 1.11 standard runtime can utilize any linux/amd64-compatible package, but all import statements must use absolute paths.\u003c/p\u003e\n"],["\u003cp\u003eGo modules are recommended for dependency management, but older GOPATH mode is still supported if you are not ready to migrate.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine uses the \u003ccode\u003ego build\u003c/code\u003e command, and to ensure module-aware mode, you should create a \u003ccode\u003ego.mod\u003c/code\u003e file in the same directory as your \u003ccode\u003eapp.yaml\u003c/code\u003e file or a parent directory.\u003c/p\u003e\n"],["\u003cp\u003eIf using the \u003ccode\u003eGO111MODULE\u003c/code\u003e environment variable, ensure its value enables module-aware mode, and it will only be applied if a \u003ccode\u003ego.mod\u003c/code\u003e file exists.\u003c/p\u003e\n"],["\u003cp\u003ePrivate dependencies must be included with your application code upon deployment, and you must utilize the \u003ccode\u003ereplace\u003c/code\u003e directive in your \u003ccode\u003ego.mod\u003c/code\u003e file to point to the local directory containing them.\u003c/p\u003e\n"]]],[],null,["# Specifying Dependencies\n\n\u003cbr /\u003e\n\nApps that run in the Go 1.11 standard runtime can use any\nlinux/amd64-compatible package.\n| **Important:** App Engine requires all import statements in your Go code to specify absolute paths. For example, use: \n|\n| ```\n| import \"github.com/example/mypackage\"\n| ```\n\nUsing Go modules\n----------------\n\nWe recommend that you use [Go modules](https://blog.golang.org/using-go-modules)\nto manage dependencies in your Go app, but\nyou can continue to use the older GOPATH mode if you aren't ready to [migrate\nto Go modules](https://blog.golang.org/migrating-to-go-modules).\n\nWhen you deploy your app, App Engine uses the `go build` command to\nbuild your app and therefore matches the behavior of Go itself. To ensure that\nyour app uses module-aware mode, do the following in your development\nenvironment:\n\n- Create your module's `go.mod` file in the same directory as your `app.yaml`\n file. App Engine searches the current directory, then successive\n parent directories until it finds a [`go.mod` file](https://golang.org/cmd/go/#hdr-Defining_a_module).\n\n If App Engine doesn't find a `go.mod` file, it follows\n GOPATH mode.\n- If you set the [`GO111MODULE` environment variable](https://golang.org/ref/mod#mod-commands),\n make sure the variable's value enables\n module-aware mode. When you deploy your app, App Engine checks your\n environment for `GO111MODULE` and matches the behavior of Go itself.\n App Engine only applies the `GO111MODULE` variable setting if you have\n included a `go.mod` file for your app.\n\n\u003c!-- --\u003e\n\n- Do not locate your app directory in or below `$GOPATH/src`. If your app is anywhere in the `$GOPATH/src` directory tree, App Engine follows GOPATH mode even if you've defined a `go.mod` file for your app.\n\n### Using private dependencies\n\nApp Engine cannot download your private dependencies during the build\nprocess, so you must include them with your application code upon deployment.\n\nYou will need to use the `replace` directive in your `go.mod` file to declare\nprivate dependencies. The following example assumes your app is in the `/myapp/`\ndirectory:\n\n1. Change to your app directory:\n\n cd /myapp\n\n2. Create a directory containing your private dependencies:\n\n mkdir private\n\n Make sure your private dependency is in the `private` directory. One\n approach is by creating a symlink: \n\n mkdir private/private.example.com\n ln -s /path/to/private.example.com/foo private/private.example.com/foo\n\n3. Update your `go.mod` file to use the `replace` directive to use the `private`\n directory for your dependency:\n\n go mod edit -replace=private.example.com/foo=./private/private.example.com/foo\n\n Your `go.mod` file should now look like: \n\n ### Final `go.mod` file\n\n module private.example.com/myapp\n\n require private.example.com/foo v1.2.3\n\n replace private.example.com/foo =\u003e ./private/private.example.com/foo\n\n ### Original `go.mod` file\n\n module private.example.com/myapp\n\n require private.example.com/foo v1.2.3\n\n4. Do not modify how you import and use your private package. Your `import`\n statement should look like:\n\n import \"private.example.com/foo\"\n\n5. Include your private dependency in your deployment by deploying your app:\n\n gcloud app deploy\n\n\u003cbr /\u003e"]]