ID is an implementation of the Attribute interface method.
()
| 393 | |
| 394 | // ID is an implementation of the Attribute interface method. |
| 395 | func (a *conditionalAttribute) ID() int64 { |
| 396 | // There's a field access after the conditional. |
| 397 | if a.truthy.ID() == a.falsy.ID() { |
| 398 | return a.truthy.ID() |
| 399 | } |
| 400 | // Otherwise return the conditional id as the consistent id being tracked. |
| 401 | return a.id |
| 402 | } |
| 403 | |
| 404 | // IsOptional returns trivially false for an attribute as the attribute represents a fully |
| 405 | // qualified variable name. If the attribute is used in an optional manner, then an attrQualifier |