Get gets a value from the replacer. It returns the value and whether the variable was known.
(variable string)
| 98 | // Get gets a value from the replacer. It returns |
| 99 | // the value and whether the variable was known. |
| 100 | func (r *Replacer) Get(variable string) (any, bool) { |
| 101 | for _, mapFunc := range r.providers { |
| 102 | if val, ok := mapFunc.replace(variable); ok { |
| 103 | return val, true |
| 104 | } |
| 105 | } |
| 106 | return nil, false |
| 107 | } |
| 108 | |
| 109 | // GetString is the same as Get, but coerces the value to a |
| 110 | // string representation as efficiently as possible. |