The Go Playground

This tour is built atop the Go Playground, a web service that runs on golang.org's servers.

The service receives a Go program, compiles, links, and runs the program inside a sandbox, then returns the output.

There are limitations to the programs that can be run in the playground:

  • In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.
  • There are also limits on execution time and on CPU and memory usage, and the program cannot access external network hosts.

    The playground uses the latest stable release of Go.

    Read "Inside the Go Playground" to learn more.

sandbox.go

  1. package main
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. func main() {
  7. fmt.Println("Welcome to the playground!")
  8. fmt.Println("The time is", time.Now())
  9. }