diff options
| author | Dave Collins <[email protected]> | 2013-03-08 22:45:02 -0600 |
|---|---|---|
| committer | Dave Collins <[email protected]> | 2013-03-08 22:45:02 -0600 |
| commit | 096da7a702285ff058a6bdd4f9a650fefcab4a00 (patch) | |
| tree | 95eee0f999c05b84890c4941fafcdaca192fbb26 /spew/doc.go | |
| parent | 534ad78b7ec4bcaea87a50676ddff2c2b2a38863 (diff) | |
Update docs for new byte array and slice behavior.
Diffstat (limited to 'spew/doc.go')
| -rw-r--r-- | spew/doc.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spew/doc.go b/spew/doc.go index 2e5acb2..8018d1d 100644 --- a/spew/doc.go +++ b/spew/doc.go @@ -28,6 +28,9 @@ printing facilities for Go data types are as follows: * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables + * Byte arrays and slices are dumped like the hexdump -C command which + includes offsets, byte values in hex, and ASCII output (only when using + Dump style) There are two different approaches spew allows for dumping Go data structures: @@ -117,6 +120,14 @@ shown here. } } +Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C +command as shown. + ([]uint8) { + 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | + 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| + 00000020 31 32 |12| + } + Custom Formatter Spew provides a custom formatter the implements the fmt.Formatter interface |
