The Go Playground この記事は Go Advent Calendar 2018 8日目の記事です。 はじめに Goで簡単にコードを書いて共有するときはThe Go Playgroundを利用することが多いと思いますが、実は隠れ機能みたいなものがあるので今回はそれを紹介します。 The Go Playground テストコードの実行 https://play.golang.org/ のページを開くと、下記のようにmain関数が用意されたPlaygroundが開きます。これだけだとmain関数をメイン処理として記述しなければならないと思いますが、全くこれ通りでなくても動くことが About に記述されています。 If the program contains tests or examples and no main function, the service runs the
![The Go Playgroundのちょっとした機能 - at kaneshin](https://cdn-ak-scissors.b.st-hatena.com/image/square/f46600b985c46c91ff5ce57f529fa49fe8f90ade/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fl%2Flaplus-knsn%2F20181208%2F20181208223241.png)