
上QQ阅读APP看书,第一时间看更新
The Go playground
The Go playground is a website where you can write and execute Go code without having to install anything. In the playground, https://play.golang.org, you can test pieces of code to explore the language and fiddle with things to understand how the language works. It also allows you to share your snippet by creating a unique URL that stores your snippet. Sharing code through the playground can be much more helpful than a plaintext snippet, since it allows the reader to actually execute the code and tinker with the source if they have any questions about how it works:

The preceding screenshot shows a simple program being run in the playground. There are buttons at the top to run, format, add import statements, and share the code with others.