From 82b493bace552ff12a3ea1ce3bfa0777850d14d7 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 28 May 2021 14:48:53 +0900 Subject: [PATCH] Add Fprintln as wrapper of fmt.Fprintln --- pretty.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pretty.go b/pretty.go index b4ca583..d211d36 100644 --- a/pretty.go +++ b/pretty.go @@ -30,6 +30,15 @@ func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error error) return fmt.Fprintf(w, format, wrap(a, false)...) } +// Fprintln is a convenience wrapper for fmt.Fprintln. +// +// Calling Fprintln(w, x, y) is equivalent to +// fmt.Fprintln(w, Formatter(x), Formatter(y)), but each operand is +// formatted with "%# v". +func Fprintln(w io.Writer, a ...interface{}) (n int, error error) { + return fmt.Fprintln(w, wrap(a, true)...) +} + // Log is a convenience wrapper for log.Printf. // // Calling Log(x, y) is equivalent to