diff options
| author | Dave Collins <[email protected]> | 2013-03-08 22:45:50 -0600 |
|---|---|---|
| committer | Dave Collins <[email protected]> | 2013-03-08 22:45:50 -0600 |
| commit | 9b87fb3e12f244b6e1d4575c39aeb2761deb5f61 (patch) | |
| tree | 74a5f4135709b21fc60a2b2a62f35c88676e71a6 /spew/example_test.go | |
| parent | 096da7a702285ff058a6bdd4f9a650fefcab4a00 (diff) | |
Add byte slice to Dump example.
Diffstat (limited to 'spew/example_test.go')
| -rw-r--r-- | spew/example_test.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spew/example_test.go b/spew/example_test.go index acbfb2a..b1ec8a2 100644 --- a/spew/example_test.go +++ b/spew/example_test.go @@ -88,9 +88,16 @@ func ExampleDump() { bar := Bar{Flag(flagTwo), uintptr(0)} s1 := Foo{bar, map[interface{}]interface{}{"one": true}} f := Flag(5) + b := []byte{ + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, + } // Dump! - spew.Dump(s1, f) + spew.Dump(s1, f, b) // Output: // (spew_test.Foo) { @@ -103,6 +110,11 @@ func ExampleDump() { // } // } // (spew_test.Flag) Unknown flag (5) + // ([]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| + // } // } |
