convert writer to buffer
This commit is contained in:
parent
4890776cfd
commit
adb5e97395
|
@ -3,7 +3,6 @@ package godo
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,7 +17,7 @@ func Stringify(message interface{}) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// stringifyValue was graciously cargoculted from the goprotubuf library
|
// stringifyValue was graciously cargoculted from the goprotubuf library
|
||||||
func stringifyValue(w io.Writer, val reflect.Value) {
|
func stringifyValue(w *bytes.Buffer, val reflect.Value) {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Ptr && val.IsNil() {
|
||||||
_, _ = w.Write([]byte("<nil>"))
|
_, _ = w.Write([]byte("<nil>"))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue