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/gofmt: doesn't simplify map key literals #16461

Closed
mdempsky opened this issue Jul 21, 2016 · 1 comment
Closed

cmd/gofmt: doesn't simplify map key literals #16461

mdempsky opened this issue Jul 21, 2016 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

$ cat bug.go
package p

type pt struct{ x, y int }

var _ = map[pt]pt{pt{0, 0}: pt{1, 1}}

$ gofmt -s bug.go
package p

type pt struct{ x, y int }

var _ = map[pt]pt{pt{0, 0}: {1, 1}}

Note it simplified pt{1, 1} to just {1, 1}, but left pt{0, 0} as is. It seems to have missed Go 1.5's language change to map literals.

/cc @griesemer

@mdempsky mdempsky added this to the Go1.8 milestone Jul 21, 2016
zegl added a commit to zegl/go that referenced this issue Aug 5, 2016
Simplify map key literals in "gofmt -s"

Fixes golang#16461

Change-Id: Ia61739b34a30ac27f6696f94a98809109a8a7b61
@gopherbot
Copy link

CL https://golang.org/cl/25530 mentions this issue.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 6, 2016
@golang golang locked and limited conversation to collaborators Oct 12, 2017
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

3 participants