Prüfen Sie, ob die neueste Version von Go installiert ist:
goversion
Editor installieren
Wenn Sie Ihre Effizienz bei der Go-Entwicklung maximieren möchten, bieten diese beliebten Editor-Plugins und IDEs die folgenden Funktionen:
vollständig integrierte Fehlerbehebungsfunktionen
Syntaxhervorhebung
Codevervollständigung
Google Cloud CLI installieren
Die Google Cloud CLI besteht aus einer Reihe von Tools für Google Cloud. Es enthält die Befehlszeilentools gcloud und bq, mit denen über die Befehlszeile auf Compute Engine, Cloud Storage, BigQuery und andere Dienste zugegriffen werden kann. Sie können diese Tools interaktiv oder in automatisierten Skripts ausführen.
Die Cloud-Clientbibliotheken für Go bieten Go-Entwicklern eine idiomatische Möglichkeit zur Integration inGoogle Cloud -Dienste wie Datastore und Cloud Storage.
Führen Sie beispielsweise den folgenden Befehl aus, um das Paket für eine einzelne API wie die Cloud Storage API zu installieren:
Wenn Sie bereits ein Go-Modul für Ihr Projekt haben, wechseln Sie zu diesem Verzeichnis.
Andernfalls erstellen Sie ein Modul:
go mod init YOUR_MODULE_NAME
Ersetzen Sie YOUR_MODULE_NAME durch den Namen des neuen Moduls.
So verwenden Sie das Cloud Storage-Paket in Ihrem Projekt:
go get cloud.google.com/go/storage
Authentifizierung einrichten
Wenn Sie die Cloud-Clientbibliotheken in einer lokalen Entwicklungsumgebung verwenden möchten, müssen Sie Standardanmeldedaten für Anwendungen einrichten.
If you're using a local shell, then create local authentication credentials for your user
account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-04-22 (UTC)."],[[["\u003cp\u003eInstall the Go programming language by following the instructions in the Go Getting Started guide to prepare for development.\u003c/p\u003e\n"],["\u003cp\u003eEnhance Go development efficiency by installing editor plugins or IDEs that offer debugging, syntax highlighting, and code completion.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the Google Cloud CLI, which includes the \u003ccode\u003egcloud\u003c/code\u003e and \u003ccode\u003ebq\u003c/code\u003e command-line tools, to interact with Google Cloud services like Compute Engine and BigQuery.\u003c/p\u003e\n"],["\u003cp\u003eIntegrate Google Cloud services into your Go projects using the Cloud Client Libraries for Go, installing them via the \u003ccode\u003ego get\u003c/code\u003e command, for example \u003ccode\u003ego get cloud.google.com/go/storage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSet up Application Default Credentials for local development by using the \u003ccode\u003egcloud auth application-default login\u003c/code\u003e command, enabling the use of Cloud Client Libraries.\u003c/p\u003e\n"]]],[],null,["# Setting up your development environment\n\nPrepare your environment for\n[Go](https://golang.org/)\napp development and deployment on Google Cloud by installing\nthe following tools.\n\nInstall Go\n----------\n\n1. To install Go, see [Go Getting Started](https://golang.org/doc/install).\n\n2. Confirm that you have the most recent version of Go installed:\n\n go version\n\nInstall an editor\n-----------------\n\nTo maximize your Go development efficacy, these\n[popular editor plugins and IDEs](https://golang.org/doc/editors.html)\nprovide the following features:\n\n- Fully integrated debugging capabilities\n- Syntax highlighting\n- Code completion\n\nInstall the Google Cloud CLI\n----------------------------\n\nThe [Google Cloud CLI](/sdk)\nis a set of tools for Google Cloud. It contains the\n[`gcloud`](/sdk/gcloud)\nand [`bq`](/bigquery/docs/bq-command-line-tool)\ncommand-line tools used to access Compute Engine, Cloud Storage,\nBigQuery, and other services from the command line. You can run these\ntools interactively or in your automated scripts.\n\nFor example, to [deploy a Go web app](/appengine/docs/standard/go/create-app) with a `main`\npackage to App Engine, run the following command: \n\n gcloud app deploy\n\nTo install the gcloud CLI, see [Installing the gcloud CLI](/sdk/install).\n\nInstall the Cloud Client Libraries for Go\n-----------------------------------------\n\nThe [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)\nis the idiomatic way for Go developers to integrate with\nGoogle Cloud services, such as Datastore and Cloud Storage.\n\nFor example, to install the package for an individual API, such as the Cloud Storage API,\ndo the following:\n\n1. If you already have a Go module for your project, change to that directory.\n Otherwise, create a module:\n\n ```\n go mod init YOUR_MODULE_NAME\n ```\n\n \u003cbr /\u003e\n\n Replace \u003cvar translate=\"no\"\u003eYOUR_MODULE_NAME\u003c/var\u003e with the name of the new module.\n2. Use the Cloud Storage package in your project:\n\n ```\n go get cloud.google.com/go/storage\n ```\n\n \u003cbr /\u003e\n\n | **Note:** The source of the Cloud Client Libraries for Go is [on GitHub](https://github.com/googleapis/google-cloud-go)\n\nSet up authentication\n---------------------\n\nTo use the Cloud Client Libraries in a local development environment, set\nup Application Default Credentials.\n\n\nIf you're using a local shell, then create local authentication credentials for your user\naccount:\n\n```bash\ngcloud auth application-default login\n```\n\nYou don't need to do this if you're using Cloud Shell.\n\n\nIf an authentication error is returned, and you are using an external identity provider\n(IdP), confirm that you have\n[signed in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\nFor more information, see\n[Authenticate for using client libraries](/docs/authentication/client-libraries).\n\nInstall other useful tools\n--------------------------\n\nFor a comprehensive list of Go tools and libraries, see\n[this list of Go frameworks, libraries, and software on GitHub](https://github.com/avelino/awesome-go).\n\nWhat's next\n-----------\n\n- Learn more about [Go on Google Cloud](/go).\n- Deploy a Go app on [App Engine](/appengine/docs/standard/go/create-app).\n- Explore [authentication methods at Google](/docs/authentication).\n- Browse the [documentation for Google Cloud products](/products).\n- Clone the [Go samples repository from GitHub](https://github.com/GoogleCloudPlatform/golang-samples)."]]