HTTP Google Cloud Functions in Go




Create HelloWorld HTTP Cloud Function

Create Gopher HTTP Cloud Function

HTTP Google Cloud Functions in Go

45 minutes 5 crédits


Google Cloud Self-Paced Labs


Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Google Cloud Functions is an event-driven serverless compute platform. Cloud Functions allows you to write your code without worrying about provisioning resources or scaling to handle changing requirements.

There are two types of Cloud Functions:

  • HTTP functions respond to HTTP requests. You'll build one in this codelab.
  • Background functions are triggered by events, like a message being published to Cloud Pub/Sub or a file being uploaded to Cloud Storage. We don't address this in this lab, but you can read more in the documentation.


This codelab will walk you through creating your own Google Cloud Function in Go.

What you will build

In this codelab, you will publish and Cloud Function that when invoked via HTTP will display an image of the Go gopher, designed by Renee French.


What you will learn

  • How to write an HTTP Cloud Function in Go.

  • How to test an HTTP Cloud Function in Go.

  • How to run a local Go HTTP server to try the function.

What you will need

  • A recent version of Go ( installation instructions). Go is already installed when using Cloud Shell.

  • The gcloud command line tool ( download page). This comes pre-installed and configured when using Cloud Shell.

  • A text editor, like the editor built into Cloud Shell

Inscrivez-vous sur Qwiklabs pour consulter le reste de cet atelier, et bien plus encore.

  • Obtenez un accès temporaire à Google Cloud Console.
  • Plus de 200 ateliers, du niveau débutant jusqu'au niveau expert.
  • Fractionné pour vous permettre d'apprendre à votre rythme.
Inscrivez-vous pour démarrer cet atelier