]> Cypherpunks repositories - gostls13.git/commit
fmtsort: sort interfaces deterministically
authorlukechampine <luke.champine@gmail.com>
Thu, 28 Feb 2019 19:03:18 +0000 (19:03 +0000)
committerKeith Randall <khr@golang.org>
Thu, 28 Feb 2019 21:09:49 +0000 (21:09 +0000)
commit9d40fadb1c3245a318b155ee3e19a4de139401dc
treefb240783b23a9066286d10542a33a006065dc06e
parent7fa195c1b9650db3e91b90af6b16405e7e0ba9ce
fmtsort: sort interfaces deterministically

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 #30398

Change-Id: I10fd4b6a74eefbc87136853af6b2e689bc76ae9d
GitHub-Last-Rev: 1b07f0c275716e1b2834f74f9c67f897bae82882
GitHub-Pull-Request: golang/go#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>
src/internal/fmtsort/sort.go
src/internal/fmtsort/sort_test.go