You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.
Imagine yourself coming to play.golang.org for the first time.
2.
Trying to experiment with something from package time, you edit the imports to include
"time": http://play.golang.org/p/CZpUiGyVho
3.
Noticing the "Format" button, you press it.
What is the expected output?
http://play.golang.org/p/-oPFe90KmG
What do you see instead?
http://play.golang.org/p/duRF5gXJEP
Please provide any additional information below.
The intent of goimports is good and everything - but only in the hands of a well
informed hacker who welcomes what goimports do (I don't). For a newbie coming to
playground, it's inexplicable why the "Format" button "eats" her
edits so far.
- There's no information and/or warning about this behavior available to the
playground's user.
- Moreover, "Format" is probably rightfully expected to change only the white
space of a program, not its semantics.
I have missed the change on the dev-list and was thus genuinely surprised the same as
any dev-list non reader could/would possibly be.
Suggestions:
- Remove the goimports functionality.
- Or make it a standalone button.
- Or disable/enable goimports by a check box.
- Avoid the confusion by providing a prominently visible information that
"Format" will remove your unused imports (and insert missing used ones, but
that's a welcome "surprise").
----
I personally avoid any automatic source changing "on save" for good (for me)
reasons. It's just my personal preference and no one is pushing such thing on me, so no
problem; neither for me nor anyone else. However, at the playground we are now forcing
such thing on the playground users in a potentially quite confusing way, which I believe
is a good intended mistake.
The text was updated successfully, but these errors were encountered:
Yeah, this is a fair complaint. Sorry for the confusion/annoyance.
I think it should be a checkbox beside the "Format" button, and the UI should store a
browser cookie to remember the checkbox state.
The text was updated successfully, but these errors were encountered: