From bf363139baee66ec55267508594f11eed339186e Mon Sep 17 00:00:00 2001 From: Howard Yeh Date: Tue, 17 Sep 2013 18:34:23 +0800 Subject: [PATCH] Prints the name of the struct type --- pretty.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pretty.go b/pretty.go index a0ca1db..3fe2b5a 100644 --- a/pretty.go +++ b/pretty.go @@ -122,7 +122,9 @@ func (p *Pretty) PrintValue(val r.Value, level int) { } else { l := val.NumField() - io.WriteString(p.Out, "struct {\n") + typeName := val.Type().String() + io.WriteString(p.Out, typeName) + io.WriteString(p.Out, " {\n") for i := 0; i < l; i++ { io.WriteString(p.Out, next) io.WriteString(p.Out, val.Type().Field(i).Name)