gopherjs / gopherjs.github.io

GopherJS Playground
https://gopherjs.github.io/playground/
23 stars 12 forks source link

Proposal: Add goimports support to Playground (add/remove stdlib imports on Format). #29

Closed dmitshur closed 8 years ago

dmitshur commented 9 years ago

The Go Playground has a checkbox to enable goimports-like fixing imports when pressing Format.

image

It's handy for fixing imports of standard library (fmt, io, bytes, etc.), and I'm used to it. I'd like to see it added to GopherJS Playground to make it better.

Any thoughts? Objections?

Should it be optional like on Go Playground or just always on?

I can volunteer to implement it. I already have implemented it locally, so it's just a matter of cleaning up the code and making a PR.

dominikh commented 9 years ago

If we're going to add it, make it optional please.

dmitshur commented 9 years ago

Ok. Is it ok for it to be on by default? I think on average more people would benefit from having it on rather than off.

dmitshur commented 8 years ago

+1 from me, I want this feature.

I may make a PR for it soon.