Skip to content
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

Closed
ALTree opened this issue Oct 23, 2019 · 6 comments
Closed

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2019

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:

hello1

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:

hello2

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.

@ALTree ALTree changed the title website: golang.org homepage has two different Hello worlds, one is not gofmt-ed x/website: golang.org homepage has two different Hello worlds, one is not gofmt-ed Oct 23, 2019
@gopherbot gopherbot added this to the Unreleased milestone Oct 23, 2019
@ALTree
Copy link
Member Author

@ALTree ALTree commented Oct 23, 2019

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Oct 23, 2019

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.

@rhnvrm
Copy link
Contributor

@rhnvrm rhnvrm commented Oct 23, 2019

I can take up this issue 👍

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 23, 2019

Change https://golang.org/cl/202824 mentions this issue: x/website: gofmt hello world code

rhnvrm added a commit to rhnvrm/website that referenced this issue Oct 23, 2019
gopherbot pushed a commit to golang/website that referenced this issue Oct 23, 2019
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>
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Oct 23, 2019

First part of this (making the default hello world snippet gofmted) is resolved, and can be previewed at https://tip.golang.org/.

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 23, 2019

Change https://golang.org/cl/202998 mentions this issue: doc/play: match the hello world snippet in x/website

@gopherbot gopherbot closed this in 20bba86 Oct 23, 2019
@golang golang locked and limited conversation to collaborators Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.