HTTP Google Cloud Functions in Go




Create HelloWorld HTTP Cloud Function

Create Gopher HTTP Cloud Function

HTTP Google Cloud Functions in Go

45分 クレジット: 5


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

Qwiklabs に参加してこのラボの残りの部分や他のラボを確認しましょう。

  • Google Cloud Console への一時的なアクセス権を取得します。
  • 初心者レベルから上級者レベルまで 200 を超えるラボが用意されています。
  • ご自分のペースで学習できるように詳細に分割されています。