The Go Playground

Clone this repo:
  1. d55b12a playground: fix vertical alignment of "Imports" checkbox by smasher164 · 8 months ago master
  2. 69dad2b examples: add an HTTP server example by Filippo Valsorda · 4 months ago
  3. d790a2e all: fix build timeouts for std dependent snippets by Alexander Rakoczy · 3 months ago
  4. 541c3c3 deploy: use gcloud to manage triggers, trigger from GCR by Heschi Kreinick · 4 months ago
  5. 9814fb9 all: increase compile timeout to 10 seconds by Alexander Rakoczy · 7 months ago


Go Reference

This subrepository holds the source for the Go playground:


# build the image
docker build -t golang/playground .


docker run --name=play --rm -p 8080:8080 golang/playground &
# run some Go code
cat /path/to/code.go | go run client.go | curl -s --upload-file - localhost:8080/compile


Deployment Triggers

Playground releases automatically triggered when new Go repository tags are pushed to GitHub, or when master is pushed on the playground repository.

For details, see deploy/go_trigger.yaml, deploy/playground_trigger.yaml, and deploy/deploy.json.

Changes to the trigger configuration can be made to the YAML files, or in the GCP UI, which should be kept in sync using the push-cloudbuild-trigger and pull-cloudbuild-trigger make targets.

Deploy via Cloud Build

The Cloud Build configuration will always build and deploy with the latest supported release of Go.

gcloud builds submit --config deploy/deploy.json .

Deploy via gcloud app deploy

Building the playground Docker container takes more than the default 10 minute time limit of cloud build, so increase its timeout first (note, app/cloud_build_timeout is a global configuration value):

gcloud config set app/cloud_build_timeout 1200  # 20 mins

Alternatively, to avoid Cloud Build and build locally:

make docker
docker tag golang/playground:latest
docker push
gcloud --project=golang-org app deploy app.yaml


gcloud --project=golang-org app deploy app.yaml


To submit changes to this repository, see