MCPcopy Create free account
hub / github.com/goadesign/goa / MapDepth

Function MapDepth

codegen/transformer.go:174–176  ·  view source on GitHub ↗

MapDepth returns the level of nested maps. For unnested maps, it returns 0.

(m *expr.Map)

Source from the content-addressed store, hash-verified

172
173// MapDepth returns the level of nested maps. For unnested maps, it returns 0.
174func MapDepth(m *expr.Map) int {
175 return mapDepth(m.ElemType.Type, 0)
176}
177
178func mapDepth(dt expr.DataType, depth int, seen ...map[string]struct{}) int {
179 if mp := expr.AsMap(dt); mp != nil {

Callers 3

mapQueryDecodeDataFunction · 0.92
transformMapFunction · 0.92
transformMapFunction · 0.85

Calls 1

mapDepthFunction · 0.85

Tested by

no test coverage detected