Running Go programs online
Sometimes, you need to test some code quickly or just want to share a code example with someone that might not have Go installed on their computer. In those situations, there are at least three websites where you can run and share Go code for free:
- The Go Playground
- The Go Play Space
- The Gotip Playground
They all share the backend infrastructure but with subtle differences.
The Go Playground
The Go team runs the Go Playground (https://play.golang.org/) on golang.org's servers. They shared some insights and its architecture in the article Inside the Go Playground (Further reading), but more recently, Brad Fitzpatrick shared the history and the implementation details of the latest incarnation of the Go Playground (Further reading).
This service receives your program, runs it on a sandbox, and returns its output. This is very convenient if you are on your mobile phone, for example, and you want to verify the syntax of a function or something else: