Get retrieves the value of the attribute with the given name. It returns the value and true if the attribute exists, or an empty string and false otherwise.
(name Name)
| 39 | // Get retrieves the value of the attribute with the given name. |
| 40 | // It returns the value and true if the attribute exists, or an empty string and false otherwise. |
| 41 | func (a *Attributes) Get(name Name) (string, bool) { |
| 42 | if attr, ok := a.m[name]; ok { |
| 43 | return attr.Value, true |
| 44 | } |
| 45 | return "", false |
| 46 | } |
| 47 | |
| 48 | // GetByString is like Get but accepts a string name. |
| 49 | func (a *Attributes) GetByString(name string) (string, bool) { |