Simplify exported spew functions by using 'ConfigState' methods

This commit is contained in:
Harald Nordgren 2019-01-19 10:02:46 +01:00
parent d8f796af33
commit 9f622107f2
1 changed files with 3 additions and 6 deletions

View File

@ -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...)
}