AsArray returns the type underlying array if any, nil otherwise.
(dt DataType)
| 201 | |
| 202 | // AsArray returns the type underlying array if any, nil otherwise. |
| 203 | func AsArray(dt DataType) *Array { |
| 204 | switch t := dt.(type) { |
| 205 | case *UserTypeExpr: |
| 206 | return AsArray(t.Type) |
| 207 | case *ResultTypeExpr: |
| 208 | return AsArray(t.Type) |
| 209 | case *Array: |
| 210 | return t |
| 211 | default: |
| 212 | return nil |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // AsMap returns the type underlying map if any, nil otherwise. |
| 217 | func AsMap(dt DataType) *Map { |
no outgoing calls