hasTag is a helper function that traverses the given attribute and all its bases recursively looking for an attribute with the given tag meta. This recursion is only needed for attributes that have not been finalized yet.
(p *AttributeExpr, tag string)
| 312 | // bases recursively looking for an attribute with the given tag meta. This |
| 313 | // recursion is only needed for attributes that have not been finalized yet. |
| 314 | func hasTag(p *AttributeExpr, tag string) bool { |
| 315 | if p.HasTag(tag) { |
| 316 | return true |
| 317 | } |
| 318 | for _, base := range p.Bases { |
| 319 | ut, ok := base.(UserType) |
| 320 | if !ok { |
| 321 | continue |
| 322 | } |
| 323 | if hasTag(ut.Attribute(), tag) { |
| 324 | return true |
| 325 | } |
| 326 | } |
| 327 | if ut, ok := p.Type.(UserType); ok { |
| 328 | return hasTag(ut.Attribute(), tag) |
| 329 | } |
| 330 | return false |
| 331 | } |
| 332 | |
| 333 | // hasTag is a helper function that traverses the given attribute and all its |
| 334 | // bases recursively looking for an attribute with the given tag meta prefix. This |
no test coverage detected