Utilities shared by complex types (ie, set and array) InnerType returns the element type for the underlying set or array type or nil if the underlying type is not a set or array.
(typ Type)
| 333 | // InnerType returns the element type for the underlying set or array type or |
| 334 | // nil if the underlying type is not a set or array. |
| 335 | func InnerType(typ Type) Type { |
| 336 | switch typ := TypeUnder(typ).(type) { |
| 337 | case *TypeSet: |
| 338 | return typ.Type |
| 339 | case *TypeArray: |
| 340 | return typ.Type |
| 341 | default: |
| 342 | return nil |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | func IsUnionType(typ Type) bool { |
| 347 | _, ok := TypeUnder(typ).(*TypeUnion) |
no test coverage detected