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

gopherbot opened this issue Feb 28, 2019 · 4 comments


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.

Copy link

@gopherbot gopherbot commented Feb 28, 2019

Change mentions this issue: [release-branch.go1.12] fmtsort: sort interfaces deterministically

Copy link

@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?

Copy link

@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.

Copy link

@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-by: Rob Pike <>
Reviewed-by: Keith Randall <>
Run-TryBot: Keith Randall <>
TryBot-Result: Gobot Gobot <>
(cherry picked from commit 9d40fad)
Run-TryBot: Brad Fitzpatrick <>
Reviewed-by: Brad Fitzpatrick <>
@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.
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.