Add appends a new parameter to the ordered list. If the key already exists, overwrite its value.
(k string, v interface{})
| 41 | // Add appends a new parameter to the ordered list. |
| 42 | // If the key already exists, overwrite its value. |
| 43 | func (p *Params) Add(k string, v interface{}) { |
| 44 | assertBareItem(v) |
| 45 | |
| 46 | if _, exists := p.values[k]; !exists { |
| 47 | p.names = append(p.names, k) |
| 48 | } |
| 49 | |
| 50 | p.values[k] = v |
| 51 | } |
| 52 | |
| 53 | // Del removes a parameter from the ordered list. |
| 54 | func (p *Params) Del(key string) bool { |