can "Run" in play.golang.org automatically include imports and format?

51 views
Skip to first unread message

Sathish VJ

unread,
May 30, 2020, 4:13:16 AM5/30/20
to golang-nuts
Is there a reason why play.golang.org needs separate buttons for Run, Format, and Imports?  Is there any reason for or anybody not doing those automatically?

Shouldn't Run automatically subsume Format and Imports?

Also, it would be good to have a keyboard shortcut to run it.  It's not convenient to shift to a mouse/trackpad.

Reto

unread,
May 30, 2020, 4:26:22 AM5/30/20
to Sathish VJ, golang-nuts
On Sat, May 30, 2020 at 01:13:16AM -0700, Sathish VJ wrote:
> Is there a reason why play.golang.org needs separate buttons for Run,
> Format, and Imports? Is there any reason for or anybody not doing those
> automatically?

Say someone has issues with their code and pastes it to play.golang.org.
You want hitting "run" to say "no module named blah" and not automatically fix the
error for them That would be very confusing.

> Shouldn't Run automatically subsume Format and Imports?

No, it should simply run the code in my opinion, after all that's what "run" means

> Also, it would be good to have a keyboard shortcut to run it. It's not
> convenient to shift to a mouse/trackpad.

There is on my computer :P install something like vimperator or use quotebrowser
or some such.

Sathish VJ

unread,
May 30, 2020, 4:32:59 AM5/30/20
to golang-nuts
> Is there a reason why play.golang.org needs separate buttons for Run, 
> Format, and Imports?  Is there any reason for or anybody not doing those 
> automatically? 

Say someone has issues with their code and pastes it to play.golang.org
You want hitting "run" to say "no module named blah" and not automatically fix the 
error for them That would be very confusing. 

>> fair enough


> Shouldn't Run automatically subsume Format and Imports? 

No, it should simply run the code in my opinion, after all that's what "run" means 

>> maybe there should be a button to do all of it together. It'd just make it easier.


> Also, it would be good to have a keyboard shortcut to run it.  It's not 
> convenient to shift to a mouse/trackpad. 

There is on my computer :P install something like vimperator or use quotebrowser 
or some such. 

>> well, me too. with vimium. :-)  But that suggestion was to include others also who don't use those extensions.

Reply all
Reply to author
Forward
0 new messages