New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/website: golang.org homepage has two different Hello worlds, one is not gofmt-ed #35099
Comments
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. |
I can take up this issue 👍 |
Change https://golang.org/cl/202824 mentions this issue: |
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 <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
First part of this (making the default hello world snippet gofmted) is resolved, and can be previewed at https://tip.golang.org/. |
Change https://golang.org/cl/202998 mentions this issue: |
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
fmt
line).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.
The text was updated successfully, but these errors were encountered: