hasTag is a helper function that traverses the given attribute and all its bases recursively looking for an attribute with the given tag meta prefix. This recursion is only needed for attributes that have not been finalized yet.
(p *AttributeExpr, prefix string)
| 334 | // bases recursively looking for an attribute with the given tag meta prefix. This |
| 335 | // recursion is only needed for attributes that have not been finalized yet. |
| 336 | func hasTagPrefix(p *AttributeExpr, prefix string) bool { |
| 337 | if p.HasTagPrefix(prefix) { |
| 338 | return true |
| 339 | } |
| 340 | for _, base := range p.Bases { |
| 341 | ut, ok := base.(UserType) |
| 342 | if !ok { |
| 343 | continue |
| 344 | } |
| 345 | if hasTagPrefix(ut.Attribute(), prefix) { |
| 346 | return true |
| 347 | } |
| 348 | } |
| 349 | if ut, ok := p.Type.(UserType); ok { |
| 350 | return hasTagPrefix(ut.Attribute(), prefix) |
| 351 | } |
| 352 | return false |
| 353 | } |
| 354 | |
| 355 | // Finalize makes sure the method payload and result types are set. It also |
| 356 | // projects the result if it is a result type and a view is explicitly set in |
no test coverage detected