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