summaryrefslogtreecommitdiff
path: root/spew
diff options
context:
space:
mode:
authorDave Collins <[email protected]>2013-03-11 18:37:09 -0500
committerDave Collins <[email protected]>2013-03-11 18:37:09 -0500
commit691853c424822ac845289705cbdf151bbb22e53b (patch)
treef9ebe8e5a6a112ff798b996cc7943098c97e150a /spew
parent7cfc3ff9658889926d0f1b3f3b4a2cf3dbe73f99 (diff)
Update docs for new Sdump function.
Diffstat (limited to 'spew')
-rw-r--r--spew/config.go3
-rw-r--r--spew/doc.go7
-rw-r--r--spew/dump.go3
3 files changed, 10 insertions, 3 deletions
diff --git a/spew/config.go b/spew/config.go
index 80e8d74..a2eab61 100644
--- a/spew/config.go
+++ b/spew/config.go
@@ -242,7 +242,8 @@ package:
The configuration options are controlled by modifying the public members
of c. See ConfigState for options documentation.
-See Fdump if you would prefer dumping to an arbitrary io.Writer.
+See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
+get the formatted result as a string.
*/
func (c *ConfigState) Dump(a ...interface{}) {
fdump(c, os.Stdout, a...)
diff --git a/spew/doc.go b/spew/doc.go
index 8018d1d..8f0df87 100644
--- a/spew/doc.go
+++ b/spew/doc.go
@@ -49,9 +49,10 @@ This section demonstrates how to quickly get started with spew. See the
sections below for further details on formatting and configuration options.
To dump a variable with full newlines, indentation, type, and pointer
-information use Dump or Fdump:
+information use Dump, Fdump, or Sdump:
spew.Dump(myVar1, myVar2, ...)
spew.Fdump(someWriter, myVar1, myVar2, ...)
+ str := spew.Sdump(myVar1, myVar2, ...)
Alternatively, if you would prefer to use format strings with a compacted inline
printing style, use the convenience wrappers Printf, Fprintf, etc with
@@ -105,6 +106,10 @@ io.Writer. For example, to dump to standard error:
spew.Fdump(os.Stderr, myVar1, myVar2, ...)
+A third option is to call spew.Sdump to get the formatted output as a string:
+
+ str := spew.Sdump(myVar1, myVar2, ...)
+
Sample Dump Output
See the Dump example for details on the setup of the types and variables being
diff --git a/spew/dump.go b/spew/dump.go
index 7286241..98a68f1 100644
--- a/spew/dump.go
+++ b/spew/dump.go
@@ -391,7 +391,8 @@ package:
The configuration options are controlled by an exported package global,
spew.Config. See ConfigState for options documentation.
-See Fdump if you would prefer dumping to an arbitrary io.Writer.
+See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
+get the formatted result as a string.
*/
func Dump(a ...interface{}) {
fdump(&Config, os.Stdout, a...)