(t types.Type)
| 65 | } |
| 66 | |
| 67 | func getOptionalElementType(t types.Type) (types.Type, bool) { |
| 68 | t = types.Unalias(t) |
| 69 | named, ok := t.(*types.Named) |
| 70 | if !ok { |
| 71 | return nil, false |
| 72 | } |
| 73 | obj := named.Obj() |
| 74 | if obj == nil || obj.Name() != "Optional" { |
| 75 | return nil, false |
| 76 | } |
| 77 | if obj.Pkg() == nil || obj.Pkg().Path() != "github.com/apache/fory/go/fory/optional" { |
| 78 | return nil, false |
| 79 | } |
| 80 | typeArgs := named.TypeArgs() |
| 81 | if typeArgs == nil || typeArgs.Len() != 1 { |
| 82 | return nil, false |
| 83 | } |
| 84 | return typeArgs.At(0), true |
| 85 | } |
| 86 | |
| 87 | // isSupportedFieldType checks if a field type is supported |
| 88 | func isSupportedFieldType(t types.Type) bool { |
no test coverage detected