Skip to content

Commit

Permalink
make "Dump" stdoutput atomic (non-interleaved)
Browse files Browse the repository at this point in the history
  • Loading branch information
reinerRubin committed Jul 17, 2019
1 parent d8f796a commit 9f61fdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spew/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"encoding/hex"
"fmt"
"io"
"os"
"reflect"
"regexp"
"strconv"
Expand Down Expand Up @@ -505,5 +504,7 @@ 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...)
buf := &strings.Builder{}
fdump(&Config, buf, a...)
fmt.Print(buf.String())
}

0 comments on commit 9f61fdc

Please sign in to comment.