Go 1.11 ha raggiunto la fine del supporto
e verrà ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment delle applicazioni Go 1.11, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment dei runtime legacy. Le tue applicazioni Go
1.11 continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti
consigliamo di eseguire la migrazione all'ultima versione supportata di Go.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Creare un'app Go 1.11 nell'ambiente standard di App Engine
ID regione
Il REGION_ID è un codice abbreviato che Google assegna
in base alla regione selezionata quando crei l'app. Il codice non
corrisponde a un paese o a una provincia, anche se alcuni ID regione possono sembrare
simili ai codici di paesi e province di uso comune. Per le app create dopo
febbraio 2020, REGION_ID.r è incluso negli
URL App Engine. Per le app esistenti create prima di questa data, l'ID regione è facoltativo nell'URL.
Questa pagina mostra come eseguire il deployment di un'applicazione App Engine di base che visualizza
un breve messaggio. Per un'introduzione più approfondita a Go su App Engine,
consulta Creare un'app.
Non sono previsti costi per l'esecuzione di questa guida. L'esecuzione di questa app di esempio
da sola non supera la quota gratuita.
Prima di iniziare
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.
Esegui questo comando per installare il
componente gcloud che include
l'estensione App Engine per Go 1.11:
gcloudcomponentsinstallapp-engine-go
Località App Engine
App Engine è regionale, il che significa che l'infrastruttura che esegue le tue app si trova in una regione specifica e Google la gestisce in modo che sia disponibile in modo ridondante in tutte le zone all'interno di quella regione.
Soddisfare i requisiti di latenza, disponibilità o durabilità è il fattore principale per la selezione della regione in cui vengono eseguite le tue app. In genere puoi
selezionare la regione più vicina agli utenti della tua app, ma devi considerare le
posizioni in cui è disponibile App Engine
e le posizioni degli altri
Google Cloud prodotti e servizi utilizzati dalla tua app. L'utilizzo di servizi
in più località può influire sulla latenza della tua app e sui relativi
prezzi.
Non puoi modificare la regione di un'app dopo averla impostata.
Se hai già creato un'applicazione App Engine, puoi visualizzarne la
regione eseguendo una delle seguenti operazioni:
Questa guida rapida presuppone che tu abbia familiarità con il linguaggio di programmazione Go
e che tu abbia installato Go.
scarica l'app Hello World
Abbiamo creato una semplice app Hello World per Go per consentirti di capire rapidamente come eseguire il deployment di un'app in Google Cloud Platform. Segui questi passaggi per scaricare Hello
World sul tuo computer locale.
Scarica l'app di esempio e vai alla directory dell'app:
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.
Passaggi successivi
Ora che hai esperienza con il deployment di un servizio web su App Engine,
leggi Creazione di un'app per un'introduzione più approfondita a Go su App Engine.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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)."]]