MCPcopy Create free account
hub / github.com/goadesign/goa / hasTag

Function hasTag

expr/method.go:314–331  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
314func 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

Callers 1

validateRequirementsMethod · 0.85

Calls 2

HasTagMethod · 0.80
AttributeMethod · 0.65

Tested by

no test coverage detected