summaryrefslogtreecommitdiff
path: root/spew/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/doc.go')
-rw-r--r--spew/doc.go7
1 files changed, 6 insertions, 1 deletions
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