From 9f622107f2e75f09b5ef7d2910c6cd6493352d4e Mon Sep 17 00:00:00 2001 From: Harald Nordgren Date: Sat, 19 Jan 2019 10:02:46 +0100 Subject: [PATCH] Simplify exported spew functions by using 'ConfigState' methods --- spew/dump.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spew/dump.go b/spew/dump.go index f78d89f..8a6f781 100644 --- a/spew/dump.go +++ b/spew/dump.go @@ -21,7 +21,6 @@ import ( "encoding/hex" "fmt" "io" - "os" "reflect" "regexp" "strconv" @@ -470,15 +469,13 @@ func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { // Fdump formats and displays the passed arguments to io.Writer w. It formats // exactly the same as Dump. func Fdump(w io.Writer, a ...interface{}) { - fdump(&Config, w, a...) + Config.Fdump(w, a...) } // Sdump returns a string with the passed arguments formatted exactly the same // as Dump. func Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(&Config, &buf, a...) - return buf.String() + return Config.Sdump(a...) } /* @@ -505,5 +502,5 @@ See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string. */ func Dump(a ...interface{}) { - fdump(&Config, os.Stdout, a...) + Config.Dump(a...) }