Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/website: golang.org homepage has two different Hello worlds, one is not gofmt-ed #35099
The "Try Go" element on the golang.org homepage has two different Hello world, one of which is not gofmt-ed.
When you load golang.org for the first time, the "Try Go" element on the right look like this:
The "Open in Playground" element links to https://play.golang.org/p/MbPUiI4y-IE, which contains a non-gofmt-ed Hello world (it uses 2 spaces to indent the
If you use the selector below to display another code snippet (say, Concurrent Pi), and then you re-select Hello world, the Hello that is displayed looks like this:
Note how this is a different Hello world (gofmt-ed, and the comment at the top is missing). The "Open in Playground" element links to a different program (https://play.golang.org/p/7vin2BK8_A6).
We should probably settle on one Hello world (gofmt-ed).
If we want to keep two (one with the "// You can edit this code!" comment at the top, and one without), we should at least gofmt the default one. It looks bad to have a non-gofmt-ed program on the homepage.
I think having the "// You can edit this code!" comment is more useful on initial page load, and less so after, because once users have changed between different snippets, it's more likely they'll understand it's editable.
But it should be simpler and more predictable to have just one version of the "Hello World" snippet (with the "// You can edit this code!" comment). It can avoid the surprise of a user changing from hello to another snippet and back, and noticing that something changed and not being sure what.
Let's fix this by consolidating the two "hello world" versions (keeping the "// You can edit this code!" comment) and gofmting it.
Updates golang/go#35099 Change-Id: I7f95871e039ed2796a3a776b311ac1d76516d4a4 GitHub-Last-Rev: 213cea2 GitHub-Pull-Request: #4 Reviewed-on: https://go-review.googlesource.com/c/website/+/202824 Run-TryBot: Dmitri Shuralyov <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Dmitri Shuralyov <email@example.com>