MCPcopy
hub / github.com/g3n/engine / debugPrint

Method debugPrint

gui/builder.go:1137–1157  ·  view source on GitHub ↗

debugPrint prints the internal attribute map of the builder for debugging. This map cannot be printed by fmt.Printf() because it has cycles. A map contains a key: _parent, which pointer to is parent map, if any.

(v interface{}, level int)

Source from the content-addressed store, hash-verified

1135// This map cannot be printed by fmt.Printf() because it has cycles.
1136// A map contains a key: _parent, which pointer to is parent map, if any.
1137func (b *Builder) debugPrint(v interface{}, level int) {
1138
1139 switch vt := v.(type) {
1140 case map[string]interface{}:
1141 level += 3
1142 fmt.Printf("\n")
1143 for mk, mv := range vt {
1144 if mk == AttribParentInternal {
1145 continue
1146 }
1147 fmt.Printf("%s%s:", strings.Repeat(" ", level), mk)
1148 b.debugPrint(mv, level)
1149 }
1150 case []map[string]interface{}:
1151 for _, v := range vt {
1152 b.debugPrint(v, level)
1153 }
1154 default:
1155 fmt.Printf(" %v (%T)\n", vt, vt)
1156 }
1157}

Callers

nothing calls this directly

Calls 1

RepeatMethod · 0.80

Tested by

no test coverage detected