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

fmt: map printing sort does not deterministically sort differing types [1.12 backport] #30484

Closed
gopherbot opened this issue Feb 28, 2019 · 4 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@randall77 requested issue #30398 to be considered for backport to the next 1.12 minor release.

@gopherbot, please open a backport issue for 1.12.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 28, 2019
@gopherbot gopherbot added this to the Go1.12.1 milestone Feb 28, 2019
@gopherbot
Copy link
Author

Change https://golang.org/cl/164617 mentions this issue: [release-branch.go1.12] fmtsort: sort interfaces deterministically

@julieqiu
Copy link
Member

@randall77 - there isn't a reason provided in the gopherbot message. Would you mind providing one for this backport?

@randall77
Copy link
Contributor

There was a bug in the map printing code introduced in 1.12 where in certain instances the map did not print deterministically.

@bradfitz bradfitz added the CherryPickApproved Used during the release process for point releases label Mar 13, 2019
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Mar 13, 2019
@gopherbot
Copy link
Author

Closed by merging 7294ede to release-branch.go1.12.

gopherbot pushed a commit that referenced this issue Mar 13, 2019
Previously, the result of sorting a map[interface{}] containing
multiple concrete types was non-deterministic. To ensure consistent
results, sort first by type name, then by concrete value.

Fixes #30484

Change-Id: I10fd4b6a74eefbc87136853af6b2e689bc76ae9d
GitHub-Last-Rev: 1b07f0c
GitHub-Pull-Request: #30406
Reviewed-on: https://go-review.googlesource.com/c/163745
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 9d40fad)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164617
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants