Propagate propagates a value under the given key to the Options descendants if any.
(key string)
| 134 | |
| 135 | // Propagate propagates a value under the given key to the Options descendants if any. |
| 136 | func (o *Options) Propagate(key string) { |
| 137 | if o.child == nil { |
| 138 | return |
| 139 | } |
| 140 | |
| 141 | if v, ok := o.m[key]; ok { |
| 142 | for c := range o.Descendants() { |
| 143 | c.m[key] = v |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // Delete removes an option by its key. |
| 149 | func (o *Options) Delete(key string) { |