Value returns the value associated with these attributes for key, or nil if no value is associated with key. The returned value should not be modified.
(key any)
| 73 | // Value returns the value associated with these attributes for key, or nil if |
| 74 | // no value is associated with key. The returned value should not be modified. |
| 75 | func (a *Attributes) Value(key any) any { |
| 76 | for cur := a; cur != nil; cur = cur.parent { |
| 77 | if cur.key == key { |
| 78 | return cur.value |
| 79 | } |
| 80 | } |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | // Equal returns whether a and o are equivalent. If 'Equal(o any) bool' is |
| 85 | // implemented for a value in the attributes, it is called to determine if the |
no outgoing calls