From b19c9bac1a282539fd34c692f9307cbf5777e57f Mon Sep 17 00:00:00 2001 From: Caleb Spare Date: Fri, 25 Mar 2016 11:35:57 -0700 Subject: [PATCH] Add Sprint Fixes #30. --- pretty.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pretty.go b/pretty.go index d3df868..b91020a 100644 --- a/pretty.go +++ b/pretty.go @@ -81,6 +81,15 @@ func Println(a ...interface{}) (n int, errno error) { 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