Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var (
// If the length of array or slice is larger than this,
// the buffer will be shorten as {...}.
BufferFoldThreshold = 1024
// PrintMapTypes when set to true will have map types will always appended to maps.
PrintMapTypes = true
)

func format(object interface{}) string {
Expand Down Expand Up @@ -155,7 +157,11 @@ func (p *printer) printMap() {
}
p.visited[p.value.Pointer()] = true

p.println("{")
if PrintMapTypes {
p.printf("%s{", p.typeString())
} else {
p.println("{")
}
p.indented(func() {
keys := p.value.MapKeys()
for i := 0; i < p.value.Len(); i++ {
Expand Down