Added a spew tag name with the very basic implementation of passing a field if the tag is set as -

This commit is contained in:
Ozum 2018-11-30 18:34:24 +00:00
parent d8f796af33
commit 094e332b2a
1 changed files with 5 additions and 0 deletions

View File

@ -415,6 +415,11 @@ func (d *dumpState) dump(v reflect.Value) {
for i := 0; i < numFields; i++ {
d.indent()
vtf := vt.Field(i)
spewTag := vtf.Tag.Get("spew")
switch spewTag {
case "-":
continue
}
d.w.Write([]byte(vtf.Name))
d.w.Write(colonSpaceBytes)
d.ignoreNextIndent = true