summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--spew/config.go6
-rw-r--r--spew/doc.go8
3 files changed, 19 insertions, 3 deletions
diff --git a/README.md b/README.md
index ed3a9fd..b62ff24 100644
--- a/README.md
+++ b/README.md
@@ -119,6 +119,14 @@ options. See the ConfigState documentation for more details.
* ContinueOnMethod
Enables recursion into types after invoking error and Stringer interface
methods. Recursion after method invocation is disabled by default.
+
+* SortKeys
+ Specifies map keys should be sorted before being printed. Use
+ this to have a more deterministic, diffable output. Note that
+ only native types (bool, int, uint, floats, uintptr and string)
+ are supported with other types sorted according to the
+ reflect.Value.String() output which guarantees display stability.
+ Natural map order is used by default.
```
## License
diff --git a/spew/config.go b/spew/config.go
index ff6b4b6..ba6dd9f 100644
--- a/spew/config.go
+++ b/spew/config.go
@@ -75,9 +75,9 @@ type ConfigState struct {
ContinueOnMethod bool
// SortKeys specifies map keys should be sorted before being printed. Use
- // this to have a more deterministic, diffable output. Note that only
- // native types (bool, int, uint, floats, uintptr and string) are supported,
- // other types will be sort according to the reflect.Value.String() output
+ // this to have a more deterministic, diffable output. Note that only
+ // native types (bool, int, uint, floats, uintptr and string) are supported
+ // with other types sorted according to the reflect.Value.String() output
// which guarantees display stability.
SortKeys bool
}
diff --git a/spew/doc.go b/spew/doc.go
index 8f0df87..2a0fb60 100644
--- a/spew/doc.go
+++ b/spew/doc.go
@@ -95,6 +95,14 @@ The following configuration options are available:
Enables recursion into types after invoking error and Stringer interface
methods. Recursion after method invocation is disabled by default.
+ * SortKeys
+ Specifies map keys should be sorted before being printed. Use
+ this to have a more deterministic, diffable output. Note that
+ only native types (bool, int, uint, floats, uintptr and string)
+ are supported with other types sorted according to the
+ reflect.Value.String() output which guarantees display stability.
+ Natural map order is used by default.
+
Dump Usage
Simply call spew.Dump with a list of variables you want to dump: