HTTP Google Cloud Functions in Go




Create HelloWorld HTTP Cloud Function

Create Gopher HTTP Cloud Function

HTTP Google Cloud Functions in Go

45 Minuten 5 Guthabenpunkte


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

Wenn Sie sich in Qwiklabs anmelden, erhalten Sie Zugriff auf den Rest des Labs – und mehr!

  • Sie erhalten vorübergehenden Zugriff auf Google Cloud Console.
  • Mehr als 200 Labs für Einsteiger und Experten.
  • In kurze Sinneinheiten eingeteilt, damit Sie in Ihrem eigenen Tempo lernen können.
Beitreten, um dieses Lab zu starten