[#110] fix json dumper

This commit is contained in:
Vadym Slizov 2020-07-26 16:07:43 +02:00
parent db09dd443f
commit eb3114b7c5
2 changed files with 6 additions and 0 deletions

View File

@ -120,6 +120,9 @@ func (d *JsonDumper) EnterNode(w walker.Walkable) bool {
// LeaveNode is invoked after node process
func (d *JsonDumper) LeaveNode(n walker.Walkable) {
fmt.Fprint(d.Writer, "}")
d.isNotFirstNode = true
d.isChildNode = false
}
func (d *JsonDumper) EnterChildNode(key string, w walker.Walkable) {

View File

@ -157,6 +157,9 @@ func (d *PrettyJsonDumper) LeaveNode(n walker.Walkable) {
fmt.Fprint(d.Writer, "\n")
d.printIndent(d.Writer)
fmt.Fprint(d.Writer, "}")
d.isNotFirstNode = true
d.isChildNode = false
}
func (d *PrettyJsonDumper) EnterChildNode(key string, w walker.Walkable) {