Skip to content

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

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

Closed
carnott-snap opened this issue Jun 18, 2020 · 7 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@carnott-snap
Copy link

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 18, 2020
@andybons andybons added this to the Unreleased milestone Jun 18, 2020
@andybons
Copy link
Member

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

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
Contributor

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

@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 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
Contributor

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 <[email protected]>
@seankhliao
Copy link
Member

No longer relevant

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
@golang golang locked and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants