Add Sprint
Fixes #30.
diff --git a/pretty.go b/pretty.go
index d3df868..b91020a 100644
--- a/pretty.go
+++ b/pretty.go
@@ -81,6 +81,15 @@
return fmt.Println(wrap(a, true)...)
}
+// Sprint is a convenience wrapper for fmt.Sprintf.
+//
+// Calling Sprint(x, y) is equivalent to
+// fmt.Sprint(Formatter(x), Formatter(y)), but each operand is
+// formatted with "%# v".
+func Sprint(a ...interface{}) string {
+ return fmt.Sprint(wrap(a, true)...)
+}
+
// Sprintf is a convenience wrapper for fmt.Sprintf.
//
// Calling Sprintf(f, x, y) is equivalent to