Update README and doc.go with new SortKeys option.
This commit is contained in:
parent
92b7ef315a
commit
550ce83cb9
|
@ -119,6 +119,14 @@ options. See the ConfigState documentation for more details.
|
||||||
* ContinueOnMethod
|
* ContinueOnMethod
|
||||||
Enables recursion into types after invoking error and Stringer interface
|
Enables recursion into types after invoking error and Stringer interface
|
||||||
methods. Recursion after method invocation is disabled by default.
|
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
|
## License
|
||||||
|
|
|
@ -75,9 +75,9 @@ type ConfigState struct {
|
||||||
ContinueOnMethod bool
|
ContinueOnMethod bool
|
||||||
|
|
||||||
// SortKeys specifies map keys should be sorted before being printed. Use
|
// SortKeys specifies map keys should be sorted before being printed. Use
|
||||||
// this to have a more deterministic, diffable output. Note that only
|
// this to have a more deterministic, diffable output. Note that only
|
||||||
// native types (bool, int, uint, floats, uintptr and string) are supported,
|
// native types (bool, int, uint, floats, uintptr and string) are supported
|
||||||
// other types will be sort according to the reflect.Value.String() output
|
// with other types sorted according to the reflect.Value.String() output
|
||||||
// which guarantees display stability.
|
// which guarantees display stability.
|
||||||
SortKeys bool
|
SortKeys bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,14 @@ The following configuration options are available:
|
||||||
Enables recursion into types after invoking error and Stringer interface
|
Enables recursion into types after invoking error and Stringer interface
|
||||||
methods. Recursion after method invocation is disabled by default.
|
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
|
Dump Usage
|
||||||
|
|
||||||
Simply call spew.Dump with a list of variables you want to dump:
|
Simply call spew.Dump with a list of variables you want to dump:
|
||||||
|
|
Loading…
Reference in New Issue