CLI tool
googleapis/google-cloud-go avatar
googleapis/google-cloud-go

google-cloud-go: Google Cloud client libraries for Go

Google Cloud Client Libraries for Go. For applications running elsewhere, such as your local development environment, you can use the gcloud auth application-default login command from the Google Cloud CLI to set user credentials in your local filesystem.

4,504 stars1,584 forksGoApache-2.0

At a glance

What is it?
The official Go packages for Google Cloud services, one module per API, authenticated through Application Default Credentials. It is the right default for Go services that live in GCP, and the wrong choice when you need a stable API surface across upgrades.
Who is it for?
Adopt google-cloud-go if your Go service already runs on Google Cloud or if you need first-party coverage of a service such as Bigtable, Storage or Pub/Sub. Do not adopt it as a thin HTTP wrapper for a single endpoint you could call yourself, and do not treat it as a stable API surface: the README warns that some packages are under development and may make backwards-incompatible changes.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 27, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What google-cloud-go actually is, and who it is for

This repository is a Go module that publishes one package per Google Cloud service. The root module is cloud.google.com/go, and each service sits in its own directory: storage, bigtable, pubsub, bigquery, firestore, and roughly a hundred more visible in the repository tree. The README frames the audience plainly: Go packages for Google Cloud Platform services.

The practical consequence of the layout is that you do not install "the SDK". You install the package for the service you use, and each of those directories carries its own version tag, which is why the release feed lists things like bigtable/v1.53.0, storage/v1.66.0 and pubsub/v2.7.0 on the same day. If your work is a Go service that reads from Cloud Storage, publishes to Pub/Sub, or scans a Bigtable table, this is the intended path. If you are writing a CLI that talks to one REST endpoint and nothing else, the per-service module layout means you pull in a dependency graph sized for that service, not for the whole cloud.

Application Default Credentials and the client construction path

Authentication is the part of this library most people meet first. Each client library uses Application Default Credentials by default, which means the credential lookup is implicit: inside Compute Engine, Kubernetes Engine or App Engine the environment supplies it and no extra step is needed, per the README. The canonical construction is a single call that takes only a context.

The README gives this example:

go
client, err := storage.NewClient(ctx)

When you are not running in a GCP environment, the README points at the Google Cloud CLI: the gcloud auth application-default login command writes user credentials to your local filesystem, and ADC picks them up automatically. For a service account key file, you either set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the key file or pass option.WithCredentialsFile to the NewClient function. The README shows the second form with a literal path:

go
client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/to/keyfile.json"))

There is a third, more explicit path. You can build credentials yourself with the credentials package, producing an auth.Credentials value, and hand it to the client with option.WithAuthCredentials. That is the escape hatch when the default detection order does not match your deployment. Note the shape of the trade-off here: the default is convenient and invisible, which is exactly why credential problems in production tend to surface as opaque errors at the first API call rather than at startup.

Installing a package and making a first call

Installation is a single go get against the package path. The README uses firestore as the placeholder and tells you to replace it with the package you want:

bash
go get cloud.google.com/go/firestore@latest # Replace firestore with the package you want to use.

After that, the package is in your module graph and you construct a client with a context. For local development outside Google Cloud, set up credentials once with the Google Cloud CLI before running anything:

bash
gcloud auth application-default login

The command writes credentials to your local filesystem, and the README states that Application Default Credentials will detect them automatically. If you run your program and the client constructor returns an error about credentials, the usual cause is that this step was skipped or that a GOOGLE_APPLICATION_CREDENTIALS variable in your shell points at a stale key file. Both are documented paths, and the README recommends reading the ADC local development page rather than improvising a credential source.

One constraint to plan for before you write code: the README states the libraries are compatible with the two most recent major Go releases, following the same policy as the Go language itself, and lists Go 1.25 and Go 1.26 as the currently supported versions. The repository go.mod declares go 1.25.0. If your build image is pinned to an older toolchain, that pin is the first thing to change, not the last.

The backwards-compatibility warning is not boilerplate

The README carries a note that is easy to skim past: some of these packages are under development, and may occasionally make backwards-incompatible changes. That sentence matters because of how the repository is versioned. Each service directory has its own release line, and the release feed shows major-version jumps in those lines: pubsub is at v2.7.0 while storage is at v1.66.0. A major bump in a Go module is a deliberate signal that the import path or the API changed.

The failure mode is mundane. You upgrade a service package because you want a fix, your code compiles because the changed surface was not in your call path, and something subtle shifts in a default or a return shape that your tests do not cover. The README does not document a deprecation window or a compatibility guarantee per package, so the version tag is the only contract you get. Treat every service package as a separate dependency with its own upgrade decision, and read the changelog for that directory rather than the repository-level CHANGES.md alone.

The second case where this library is the wrong tool is when you are not on Google Cloud and not planning to be. The library is a client for Google Cloud APIs. If you need a storage abstraction that works against S3, GCS and a local filesystem behind one interface, this is not that layer, and wrapping it to become that layer is more work than picking an abstraction that was designed for it.

How it compares to calling the REST or gRPC APIs directly

The alternative most teams weigh is generating their own client from the service's protobuf definitions, or calling the JSON REST API with net/http. The difference is in what the library owns. The repository's go.mod pulls google.golang.org/api, google.golang.org/grpc, google.golang.org/protobuf, google.golang.org/genproto/googleapis/rpc, cloud.google.com/go/auth and the OpenTelemetry packages. Those dependencies are doing work you would otherwise write: transport, retry and backoff policy, credential refresh, and tracing hooks.

A hand-rolled client gives you a much smaller dependency graph and total control over retry semantics, which matters if your service has strict latency budgets or you are auditing every transitive dependency. The cost is that you now own credential refresh, pagination, and the mapping between generated types and your domain types, and you own it across every API you touch. For a single endpoint with simple request shapes, that trade is often worth it. For a service that touches several Google Cloud APIs, reimplementing the credential and transport layer per API is the kind of work that looks cheap in a design doc and expensive in month three.

A middle option sits inside this library: use the generated client for transport and credentials, then keep your own thin wrapper around it so the rest of your code does not import the service package directly. That keeps the upgrade surface small without giving up the credential handling.

Maintenance cadence, licensing and what an upgrade costs you

The repository is not archived, and the last push was on 2026-08-28. The release feed shows three service packages published within two days of that date, which is consistent with a release process that ships per service rather than in one coordinated cut. The presence of .release-please-bulk-manifest.json, .release-please-individual-manifest.json and .release-please-preview-manifest.json in the repository root, alongside a RELEASING.md, indicates the manifests drive separate bulk, individual and preview release tracks. That structure explains why you should expect frequent, small version bumps on the packages you depend on rather than occasional large ones.

Upgrade cost therefore scales with how many service packages you import. Each one is a separate line in go.mod with its own tag, and a routine go get -u ./... can move several of them at once. Pinning versions and upgrading one service at a time keeps the blast radius small.

The licence is Apache-2.0, the same licence Google uses across many of its open source projects. That is a permissive licence, and it is the same identifier you will find in the LICENSE file at the repository root. This is a description of what the repository states, not legal advice; if your organisation has rules about dependency licences or about the patent grant language in Apache-2.0, run the module through your own review process.

One thing the README does not document is a rollback procedure for a bad service package release. Go modules make rollback mechanical at the version level, but nothing in the repository describes a supported downgrade path or a compatibility shim, so the practical answer is the version pin.

Frequently asked questions

The questions below come from what people search for around this project. Where the README is silent, the answer says so rather than guessing.

Editorial conclusion

Adopt google-cloud-go if your Go service already runs on Google Cloud or if you need first-party coverage of a service such as Bigtable, Storage or Pub/Sub. Do not adopt it as a thin HTTP wrapper for a single endpoint you could call yourself, and do not treat it as a stable API surface: the README warns that some packages are under development and may make backwards-incompatible changes. Before you commit, pin the package version you actually depend on, check the Go version policy against your toolchain, and confirm the specific submodule you need exists under its own version tag rather than assuming the root module covers it.

Frequently asked questions

What is google-cloud-go?

It is the repository of Go packages for Google Cloud Platform services, published under the module path cloud.google.com/go. Each service lives in its own directory, such as storage, bigtable or pubsub, and is installed separately with go get.

Is google-cloud-go free to use?

The repository is released under the Apache-2.0 licence, which permits commercial use. The library itself is free; the Google Cloud services you call through it are billed separately, and the README does not describe any pricing for the packages.

Is google-cloud-go going away?

Nothing in the repository indicates that. It is not archived, the last push was on 2026-08-28, and service packages including bigtable, storage and pubsub were published on 2026-08-27 and 2026-08-28.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/googleapis-google-cloud-go.svg)](https://hysenlabs.com/projects/googleapis-google-cloud-go)