diff options
| author | Dave Collins <[email protected]> | 2013-11-14 19:11:52 -0800 |
|---|---|---|
| committer | Dave Collins <[email protected]> | 2013-11-14 19:11:52 -0800 |
| commit | f13f098c7a759ac1c79318d6aee18426939db828 (patch) | |
| tree | 88f873e88a3782c3f821c3f502611025c5bb7ba4 /spew/format.go | |
| parent | 1fe9f5ca4b46a8247ae5939097f5cfc5d8370729 (diff) | |
| parent | 8e1b34364faac53e7da8801da5baf0c0df120a42 (diff) | |
Merge pull request #13 from pmezard/add-option-to-sort-map-keys
config: add SortKeys option to sort native map keys before display
Diffstat (limited to 'spew/format.go')
| -rw-r--r-- | spew/format.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spew/format.go b/spew/format.go index 70785fa..fc57fda 100644 --- a/spew/format.go +++ b/spew/format.go @@ -302,6 +302,9 @@ func (f *formatState) format(v reflect.Value) { f.fs.Write(maxShortBytes) } else { keys := v.MapKeys() + if f.cs.SortKeys { + SortValues(keys) + } for i, key := range keys { if i > 0 { f.fs.Write(spaceBytes) |
