(spec FieldSpec, xlang bool, defaultTrackRef bool)
| 617 | } |
| 618 | |
| 619 | func fieldDeclaredTrackRef(spec FieldSpec, xlang bool, defaultTrackRef bool) bool { |
| 620 | if spec.Type == nil { |
| 621 | return false |
| 622 | } |
| 623 | explicit := false |
| 624 | trackRef := defaultTrackRef |
| 625 | if spec.Type.hasDeclRef { |
| 626 | explicit = true |
| 627 | trackRef = spec.Type.declRef |
| 628 | } |
| 629 | if spec.RefSet { |
| 630 | explicit = true |
| 631 | trackRef = spec.Ref |
| 632 | } |
| 633 | if !trackRef || !NeedWriteRef(spec.Type.TypeID) { |
| 634 | return false |
| 635 | } |
| 636 | if xlang && isCollectionType(spec.Type.TypeID) && !explicit { |
| 637 | return false |
| 638 | } |
| 639 | return true |
| 640 | } |
| 641 | |
| 642 | func finalizeResolvedTypeSpec(goType reflect.Type, spec *TypeSpec) (*TypeSpec, error) { |
| 643 | if spec == nil || goType == nil { |
no test coverage detected