diff --git a/printer.go b/printer.go index b68615c..c7adee9 100644 --- a/printer.go +++ b/printer.go @@ -158,7 +158,7 @@ func (p *printer) printMap() { p.visited[p.value.Pointer()] = true if PrintMapTypes { - p.printf("%s{", p.typeString()) + p.printf("%s{\n", p.typeString()) } else { p.println("{") } diff --git a/printer_test.go b/printer_test.go index cd2ada7..7558779 100644 --- a/printer_test.go +++ b/printer_test.go @@ -175,6 +175,16 @@ var ( } `, }, + { + map[string]interface{}{"foo": 10, "bar": map[int]int{20: 30}}, ` + [green]map[string]interface {}[reset]{ + [red][bold]"[reset][red]foo[reset][red][bold]"[reset]: [blue][bold]10[reset], + [red][bold]"[reset][red]bar[reset][red][bold]"[reset]: [green]map[int]int[reset]{ + [blue][bold]20[reset]: [blue][bold]30[reset], + }, + } + `, + }, } arr [3]int