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: format in playground creates invalid code #41195

Closed
rogpeppe opened this issue Sep 2, 2020 · 4 comments
Closed

cmd/go2go: format in playground creates invalid code #41195

rogpeppe opened this issue Sep 2, 2020 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Sep 2, 2020

The Format button in https://go2goplay.golang.org/ adds a type prefix to all the type parameters, which it then rejects as a syntax error.
To reproduce, just go to https://go2goplay.golang.org/ and click Format, then Run.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 2, 2020
@dmitshur dmitshur added this to the Unreleased milestone Sep 2, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Sep 2, 2020

/cc @griesemer @andybons

@griesemer griesemer self-assigned this Sep 2, 2020
@gopherbot
Copy link

Change https://golang.org/cl/252879 mentions this issue: [dev.go2go] cmd/gofmt, go/format: set []-mode for type parameters in a few more places

@griesemer
Copy link
Contributor

I assumed this was fixed with https://go-review.googlesource.com/c/go/+/251278 but I guess not. Trying once more.

The real fix is to remove all the various parsing and printing modes again, now that we have presumably settled on the type parameter list syntax.

@griesemer griesemer added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 2, 2020
gopherbot pushed a commit that referenced this issue Sep 2, 2020
…a few more places

Now that we have mostly settled on the type parameter list syntax we should
probably remove the various modes of parsing and printing. For now just set
the UseBrackets flag explicitly when printing.

Updates #41195.

Change-Id: I56b06b4f930908579a38a140e8221618c8e2fa17
Reviewed-on: https://go-review.googlesource.com/c/go/+/252879
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
@griesemer
Copy link
Contributor

This is now also fixed in the playground after a recent update.

@golang golang locked and limited conversation to collaborators Sep 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants