|
@@ -17,6 +17,7 @@
|
|
|
package spew
|
|
package spew
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "bytes"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"io"
|
|
"io"
|
|
|
"os"
|
|
"os"
|
|
@@ -247,6 +248,14 @@ func (c *ConfigState) Dump(a ...interface{}) {
|
|
|
fdump(c, os.Stdout, a...)
|
|
fdump(c, os.Stdout, a...)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Sdump returns a string with the passed arguments formatted exactly the same
|
|
|
|
|
+// as Dump.
|
|
|
|
|
+func (c *ConfigState) Sdump(a ...interface{}) string {
|
|
|
|
|
+ var buf bytes.Buffer
|
|
|
|
|
+ fdump(c, &buf, a...)
|
|
|
|
|
+ return buf.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// convertArgs accepts a slice of arguments and returns a slice of the same
|
|
// convertArgs accepts a slice of arguments and returns a slice of the same
|
|
|
// length with each argument converted to a spew Formatter interface using
|
|
// length with each argument converted to a spew Formatter interface using
|
|
|
// the ConfigState associated with s.
|
|
// the ConfigState associated with s.
|