MaybeAttribute collects variants of unchecked AbsoluteAttribute values which could either be direct variable accesses or some combination of variable access with qualification.
(id int64, name string)
| 201 | // MaybeAttribute collects variants of unchecked AbsoluteAttribute values which could either be |
| 202 | // direct variable accesses or some combination of variable access with qualification. |
| 203 | func (r *attrFactory) MaybeAttribute(id int64, name string) Attribute { |
| 204 | var names []string |
| 205 | // When there's a single name with a dot prefix, it indicates that the 'maybe' attribute is a |
| 206 | // globally namespaced identifier. |
| 207 | if strings.HasPrefix(name, ".") { |
| 208 | names = append(names, name) |
| 209 | } else { |
| 210 | // In all other cases, the candidate names should be inferred. |
| 211 | names = r.container.ResolveCandidateNames(name) |
| 212 | } |
| 213 | return &maybeAttribute{ |
| 214 | id: id, |
| 215 | attrs: []NamespacedAttribute{ |
| 216 | r.AbsoluteAttribute(id, names...), |
| 217 | }, |
| 218 | adapter: r.adapter, |
| 219 | provider: r.provider, |
| 220 | fac: r, |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // RelativeAttribute refers to an expression and an optional qualifier path. |
| 225 | func (r *attrFactory) RelativeAttribute(id int64, operand Interpretable) Attribute { |
nothing calls this directly
no test coverage detected