Go 1.11 telah mencapai akhir dukungan
dan akan dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Go 1.11, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Go 1.11 yang ada akan terus berjalan dan menerima traffic setelah tanggal penghentiannya. Sebaiknya Anda bermigrasi ke Go versi terbaru yang didukung.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Membuat aplikasi Go 1.11 di lingkungan standar App Engine
ID wilayah
REGION_ID adalah kode singkat yang ditetapkan Google berdasarkan region yang Anda pilih saat membuat aplikasi. Kode ini tidak sesuai dengan negara atau provinsi, meskipun beberapa ID region mungkin tampak mirip dengan kode negara dan provinsi yang umum digunakan. Untuk aplikasi yang dibuat setelah Februari 2020, REGION_ID.r disertakan dalam URL App Engine. Untuk aplikasi lama yang dibuat sebelum tanggal tersebut, ID region bersifat opsional dalam URL.
Halaman ini menunjukkan cara men-deploy aplikasi App Engine dasar yang menampilkan pesan singkat. Untuk pengantar yang lebih mendalam tentang Go on App Engine,
lihat Mem-build Aplikasi.
Panduan ini bersifat gratis. Menjalankan aplikasi contoh ini saja
tidak melebihi kuota gratis Anda.
Sebelum memulai
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Jalankan perintah berikut untuk menginstal komponen gcloud yang menyertakan ekstensi App Engine untuk Go 1.11:
gcloudcomponentsinstallapp-engine-go
Lokasi App Engine
App Engine bersifat regional. Artinya, infrastruktur yang menjalankan aplikasi Anda terletak di region tertentu, dan Google mengelolanya sehingga aplikasi Anda tersedia secara redundan di semua zona dalam region tersebut.
Memenuhi persyaratan latensi, ketersediaan, atau ketahanan adalah faktor
utama untuk memilih region tempat aplikasi dijalankan. Umumnya, Anda dapat memilih region yang paling dekat dengan pengguna aplikasi Anda, tetapi Anda harus mempertimbangkan lokasi tempat App Engine tersedia serta lokasi dari produk dan layananGoogle Cloud lainnya yang digunakan aplikasi Anda. Penggunaan layanan
di beberapa lokasi dapat memengaruhi latensi dan
harga aplikasi.
Anda tidak dapat mengubah region aplikasi setelah menyetelnya.
Jika sudah membuat aplikasi App Engine, Anda dapat melihat
region-nya dengan melakukan salah satu tindakan berikut:
Panduan memulai ini mengasumsikan bahwa Anda sudah memahami bahasa pemrograman Go
dan telah menginstal Go.
Download aplikasi Halo Dunia
Kami telah membuat aplikasi Halo Dunia sederhana untuk Go sehingga Anda bisa dengan cepat memahami cara men-deploy aplikasi ke Google Cloud Platform. Ikuti langkah-langkah ini untuk mendownload Hello
World ke komputer lokal Anda.
Download aplikasi contoh dan buka direktori aplikasi:
In the project list, select the project that you
want to delete, and then click Delete.
In the dialog, type the project ID, and then click
Shut down to delete the project.
Langkah berikutnya
Setelah Anda memiliki pengalaman men-deploy layanan web di App Engine,
dapatkan pengantar yang lebih mendalam tentang Go di App Engine dengan membaca
Mem-build Aplikasi.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[[["\u003cp\u003eThis guide walks you through deploying a basic "Hello World" Go 1.11 application to the App Engine standard environment.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps are regional, meaning the infrastructure is located in a specific region you must select during the initial setup, and this region cannot be changed later.\u003c/p\u003e\n"],["\u003cp\u003eTo begin, you'll need to initialize your App Engine app using the gcloud CLI, specifying your project and selecting a region.\u003c/p\u003e\n"],["\u003cp\u003eThe sample "Hello World" app can be downloaded from a GitHub repository, and then deployed to App Engine with the \u003ccode\u003egcloud app deploy\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eAfter deploying, the live app can be viewed at a URL containing your project ID and the selected region, and you have the option to delete your project to stop all billing if you are finished.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Create a Go 1.11 app in the App Engine standard environment\n\nCreate a Go 1.11 app in the App Engine standard environment\n===========================================================\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/legacy/standard/go111/how-requests-are-routed#region-id). \nOK\n\nThis page shows you how to deploy a basic App Engine application that displays\na short message. For a more in-depth introduction to Go on App Engine,\nsee [Building an App](/appengine/docs/legacy/standard/go111/building-app).\n\nIs App Engine the right computing option for you? See other\n[options for hosting your application on Google Cloud](/docs/choosing-a-compute-option).\n\nCosts\n-----\n\nThere are no costs associated with running this guide. Running this sample app\nalone does not exceed your [free quota](/appengine/docs/legacy/standard/go111/quotas).\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Cloud Build API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com)\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Cloud Build API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com)\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n\n\u003cbr /\u003e\n\nAdditional prerequisites\n------------------------\n\n1. Initialize your App Engine app with your project and choose its region:\n\n gcloud app create --project=[YOUR_PROJECT_ID]\n\n When prompted, select the [region](/appengine/docs/legacy/standard/go111/locations)\n where you want to locate your App Engine application.\n | **Caution**: You cannot change an app's region once it has been set.\n2. Install the following prerequisites:\n\n - [Download\n and install Git](https://git-scm.com/).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n3. \n - Run the following command to install the\n [gcloud component](/sdk/docs/managing-components) that includes the\n App Engine extension for Go 1.11:\n\n gcloud components install app-engine-go\n\n### App Engine locations\n\n\u003cbr /\u003e\n\nApp Engine is *regional* , which means the infrastructure that runs your apps is\nlocated in a specific region, and Google manages it so that it is available\nredundantly across\n[all of the zones within that region](/docs/geography-and-regions).\n\nMeeting your latency, availability, or durability requirements are primary\nfactors for selecting the region where your apps are run. You can generally\nselect the region nearest to your app's users, but you should consider [the\nlocations where App Engine is available](/about/locations#region)\nas well as the [locations](/about/locations#region) of the other\nGoogle Cloud products and services that your app uses. Using services\nacross multiple locations can affect your app's latency as well as its\n[pricing](/appengine/pricing).\n\nYou cannot change an app's region after you set it.\n| **Note:** Two locations, which are called `europe-west` and `us-central` in App Engine commands and in the Google Cloud console, are called `europe-west1` and `us-central1`, respectively, elsewhere in Google documentation.\n\nIf you already created an App Engine application, you can view its\nregion by doing one of the following:\n\n- Run the `gcloud app describe` command.\n\n- Open the\n [App Engine Dashboard in the Google Cloud console](https://console.cloud.google.com/appengine).\n The region appears near the top of the page.\n\nOK\n\nThis quickstart assumes that you are familiar with the Go programming language\nand that you have [installed Go](https://golang.org/doc/install).\n\nDownload the Hello World app\n----------------------------\n\nWe've created a simple Hello World app for Go so you can quickly get a feel for\ndeploying an app to Google Cloud Platform. Follow these steps to download Hello\nWorld to your local machine.\n\nDownload the sample app and navigate into the app directory:\n\n1. Clone the [Hello World sample app repository](https://github.com/GoogleCloudPlatform/golang-samples.git):\n\n git clone https://github.com/GoogleCloudPlatform/golang-samples\n\n Alternatively, [download](https://github.com/GoogleCloudPlatform/golang-samples/archive/master.zip)\n the sample as a zip file and extract it.\n2. Change to the directory that contains the sample code:\n\n cd golang-samples/appengine/go11x/helloworld/\n\nDeploying Hello World to App Engine\n-----------------------------------\n\n1. Deploy the Hello World app on App Engine by running the following\n command from the `golang-samples/appengine/go11x/helloworld` directory:\n\n gcloud app deploy\n\n2. View the live app at\n `https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`:\n\n gcloud app browse\n\nThe message **Hello, World!** is now delivered by a web server running on\nan App Engine instance.\n\n**Congratulations!** You've successfully deployed a Go web service on\nApp Engine!\n\nClean up\n--------\n\nIf you want to continue learning about App Engine, you can keep\nyour Google Cloud project and follow along with\n[Building an App](/appengine/docs/legacy/standard/go111/building-app).\n\nAlternatively, you can delete your Google Cloud project to stop billing\nfor all the resources used within that project.\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.\n| - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n|\n|\n| If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects\n| can help you avoid exceeding project quota limits.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\nNow that you have experience deploying a web service on App Engine,\nget a more in-depth introduction to Go on App Engine by reading\n[Building an App](/appengine/docs/legacy/standard/go111/building-app)."]]