From 3e6e67c4dcea3ac2f25fd4731abc0e1deaf36216 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 31 Mar 2015 13:55:04 -0700 Subject: Enable methods to sort map keys and spew itself as last resort If enabled by flags, try to use methods to stringify map keys and sort on that. If we can't use primitive sorting and we can't use methods, we can still fall back on spew itself. If SpewKeys is enabled, use Sprintf("%#v") to generate a string and sort by that. --- spew/internal_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spew/internal_test.go') diff --git a/spew/internal_test.go b/spew/internal_test.go index 10dc0b1..b583bfd 100644 --- a/spew/internal_test.go +++ b/spew/internal_test.go @@ -151,6 +151,6 @@ func TestAddedReflectValue(t *testing.T) { // SortValues makes the internal sortValues function available to the test // package. -func SortValues(values []reflect.Value) { - sortValues(values) +func SortValues(values []reflect.Value, cs *ConfigState) { + sortValues(values, cs) } -- cgit v1.2.3