Prepare your environment for Go app development and deployment on Google Cloud by installing the following tools.
Install Go
To install Go, see Go Getting Started.
Confirm that you have the most recent version of Go installed:
go version
Install an editor
To maximize your Go development efficacy, these popular editor plugins and IDEs provide the following features:
- Fully integrated debugging capabilities
- Syntax highlighting
- Code completion
Install the Cloud SDK
The Cloud SDK
is a set of tools for Cloud SDK. It contains the
gcloud
,
gsutil
,
and bq
command-line tools used to access Compute Engine, Cloud Storage,
BigQuery, and other services from the command line. You can run these
tools interactively or in your automated scripts.
For example, to deploy a Go web app with a main
package to App Engine, run the following command:
gcloud app deploy
To install the Cloud SDK, see Installing the Cloud SDK.
Install the Cloud Client Libraries for Go
The Cloud Client Libraries for Go is the idiomatic way for Go developers to integrate with Google Cloud services, such as Datastore and Cloud Storage.
For example, to install the package for an individual API, such as the Cloud Storage API, do the following:
If you already have a Go module for your project, change to that directory. Otherwise, create a module:
go mod init YOUR_MODULE_NAME
Replace
YOUR_MODULE_NAME
with the name of the new module.Use the Cloud Storage package in your project:
go get cloud.google.com/go/storage
To learn how to authenticate with APIs, see Set up authentication.
Install other useful tools
For a comprehensive list of Go tools and libraries, see this list of Go frameworks, libraries, and software on GitHub.
What's next
- Learn more about Go on Google Cloud.
- Deploy a Go app on App Engine.
- Browse the documentation for Google Cloud products.
- Clone the Go samples repository from GitHub.