summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTim Hockin <[email protected]>2015-03-31 13:55:04 -0700
committerTim Hockin <[email protected]>2015-04-10 08:46:42 -0700
commit3e6e67c4dcea3ac2f25fd4731abc0e1deaf36216 (patch)
tree42e0d210e3ed2efe1cc4e931135d0956398de246 /README.md
parentfc32781af5e85e548d3f1abaf0fa3dbe8a72495c (diff)
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.
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index c84c4ad..7a5960f 100644
--- a/README.md
+++ b/README.md
@@ -132,9 +132,16 @@ options. See the ConfigState documentation for more details.
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.
+ and types which implement error or Stringer interfaces are supported,
+ with other types sorted according to the reflect.Value.String() output
+ which guarantees display stability. Natural map order is used by
+ default.
+
+* SpewKeys
+ SpewKeys specifies that, as a last resort attempt, map keys should be
+ spewed to strings and sorted by those strings. This is only considered
+ if SortKeys is true.
+
```
## License