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

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 28, 2019

@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
Copy link
Author

@gopherbot gopherbot commented Feb 28, 2019

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

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Mar 12, 2019

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

@randall77
Copy link
Contributor

@randall77 randall77 commented Mar 12, 2019

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

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 13, 2019

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

@gopherbot gopherbot closed this Mar 13, 2019
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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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