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

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jul 21, 2016

$ 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

@gopherbot gopherbot commented Aug 5, 2016

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

@quentinmit quentinmit added the NeedsFix label Oct 6, 2016
@gopherbot gopherbot closed this in 56b5546 Oct 12, 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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