whatisgithub

What is golang-samples?

googlecloudplatform/golang-samples — explained in plain English

Analysis updated 2026-06-26

4,616GoAudience · developerComplexity · 2/5LicenseSetup · moderate

In one sentence

Google's official collection of working Go code samples showing how to connect Go programs to Google Cloud Platform services. Copy the code you need into your own project, these are reference examples, not a library to import.

Mindmap

mindmap
  root((golang-samples))
    What it does
      GCP code examples
      Working Go samples
      API integration
    Coverage
      Many GCP services
      Official examples
      Linked from docs
    How to use
      Copy into project
      Not a library
      Browse by service
    Contributing
      Bug fix PRs
      New sample requests
    Audience
      Go developers
      GCP users
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Copy a working Go sample to quickly connect your application to a Google Cloud API like Cloud Storage, Pub/Sub, or BigQuery

USE CASE 2

Use an official sample as a starting point when integrating a new Google Cloud service into an existing Go backend

USE CASE 3

Reference working code when the Google Cloud documentation example feels incomplete or outdated

USE CASE 4

Contribute a bug fix or request a new sample for a Google Cloud service you are actively using

What is it built with?

GoGoogle Cloud Platform

How does it compare?

googlecloudplatform/golang-samplesnginx-proxy/docker-genantoniomika/sish
Stars4,6164,6254,626
LanguageGoGoGo
Setup difficultymoderatemoderatemoderate
Complexity2/53/53/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Google Cloud account and configured application credentials, copy samples into your own project rather than importing them as a library dependency.

Apache 2.0, use, modify, and redistribute freely for any purpose including commercial projects, with attribution required.

So what is it?

This repository is Google's official collection of sample programs written in the Go programming language that show how to use Google Cloud Platform services. Go (also called Golang) is a programming language developed by Google and widely used for building backend services and command-line tools. The samples cover a range of Google Cloud products. Some of them have accompanying written guides on the Google Cloud documentation site, and the full catalog can be browsed at the Google Cloud Samples page filtered by the Go language. The README itself is brief and does not list the specific services covered, but the repository is maintained by the Google Cloud Platform organization and is linked from official documentation. The intended audience is Go developers who want concrete, working code showing how to connect their programs to Google Cloud APIs. The README is explicit on one important point: you should copy any code you need from this repo into your own project rather than importing it as a library dependency. The reason is that the samples can change at any time without warning and are not designed to be stable packages that other programs rely on. Contributions are accepted. New sample requests can be opened as GitHub issues, and bug fixes can be submitted as pull requests. A separate CONTRIBUTING.md file in the repository contains the detailed guidelines. The code is licensed under the Apache 2.0 license, which permits free use, modification, and redistribution in both personal and commercial projects.

Copy-paste prompts

Prompt 1
Find me the golang-samples example for uploading a file to Google Cloud Storage and show me how to adapt it for my Go project
Prompt 2
Show me how to use the golang-samples Pub/Sub example to publish and subscribe to messages from a Go service
Prompt 3
I want to query Google Cloud BigQuery from Go, which golang-samples file should I look at and how do I run it locally?
Prompt 4
How do I set up Google Cloud application credentials locally so I can run the golang-samples examples on my machine?
Prompt 5
Show me the golang-samples example for calling the Google Cloud Vision API to detect text in an image using Go

Frequently asked questions

What is golang-samples?

Google's official collection of working Go code samples showing how to connect Go programs to Google Cloud Platform services. Copy the code you need into your own project, these are reference examples, not a library to import.

What language is golang-samples written in?

Mainly Go. The stack also includes Go, Google Cloud Platform.

What license does golang-samples use?

Apache 2.0, use, modify, and redistribute freely for any purpose including commercial projects, with attribution required.

How hard is golang-samples to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is golang-samples for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.