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

cmd/go2go: go2goplay does not have feature parity with play.golang.org #39675

Open
carnott-snap opened this issue Jun 18, 2020 · 6 comments
Open

cmd/go2go: go2goplay does not have feature parity with play.golang.org #39675

carnott-snap opened this issue Jun 18, 2020 · 6 comments

Comments

@carnott-snap
Copy link

@carnott-snap carnott-snap commented Jun 18, 2020

What did you do?

https://go2goplay.golang.org/p/Qho_zVlH3vu

What did you expect to see?

0

What did you see instead?

package name must be main
@andybons andybons added this to the Unreleased milestone Jun 18, 2020
@andybons
Copy link
Member

@andybons andybons commented Jun 18, 2020

When initially implementing the go2go playground I remember running into some issues but I’m forgetting what they were.

/cc @ianlancetaylor @griesemer @toothrot

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 19, 2020

I also forget, if I ever know. I guess it is the playground code reporting that error? What happens if you just remove that check?

I've never actually built the playground myself, maybe I'll try it later if I find time.

@thepudds
Copy link

@thepudds thepudds commented Jun 19, 2020

Perhaps related, or perhaps not related, but go2goplay.golang.org also does not seem to recognize test cases. It instead reports:

# play
runtime.main_main·f: function main is undeclared in the main package

This does not work:
https://go2goplay.golang.org/p/iw-9AIAjutO

But this does:
https://play.golang.org/p/rtBwSht8Urf

Those are from #39634.

@smasher164
Copy link
Member

@smasher164 smasher164 commented Jun 21, 2020

@andybons Out of curiosity, where does the code for the go2go playground live? I'd like take a stab at adding multifile support.

@andybons andybons changed the title cmd/go2go: playground does not handle multifile syntax cmd/go2go: playground only supports single-file, non-test, main package mode Jun 21, 2020
@andybons
Copy link
Member

@andybons andybons commented Jun 21, 2020

I should have been more clear: it is known that go2goplay only handles single-file, non-test, main-package cases only for now. None of the additional functionality that the playground has accumulated over the years (multiple files, test cases, modules support, etc.) works. I remember looking into supporting these things but time-boxed myself into just getting the basic use-case up and running. I don’t remember the specific details of what issues I ran into when adjusting the playground code, nor do I know how long the go2go tool will be viable for/how much churn there will be with it.

@smasher164 https://golang.org/cl/238518 has the changes that are currently deployed. We may put that in its own branch since the dev.go2go branch now exists so there’s precedent.

@andybons andybons changed the title cmd/go2go: playground only supports single-file, non-test, main package mode cmd/go2go: go2goplay does not have feature parity with play.golang.org Jun 30, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 30, 2020

Change https://golang.org/cl/240541 mentions this issue: all: go2goplay.golang.org source

gopherbot pushed a commit to golang/playground that referenced this issue Jun 30, 2020
This CL contains the altered playground source that is served
at go2goplay.golang.org.

It compiles the toolchain at the dev.go2go branch of the main
Go repository, translates .go2 programs using the go2go tool,
and compiles the playground frontend binary using the dev.go2go
toolchain (to support code formatting).

The header and “About” text is updated to differentiate from
the normal playground and explain its differences,
code location, etc.

Most features present on play.golang.org are missing, and this
instance only supports single-file, non-test, main-package
programs. This was done for initial simplicity of the
implementation.

Updates golang/go#39675
Fixes golang/go#39809

Change-Id: Id9461830c4233ab3f938dc6d21da3e5f2d8adbc3
Reviewed-on: https://go-review.googlesource.com/c/playground/+/240541
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.