Del removes a parameter from the ordered list.
(key string)
| 52 | |
| 53 | // Del removes a parameter from the ordered list. |
| 54 | func (p *Params) Del(key string) bool { |
| 55 | if _, ok := p.values[key]; !ok { |
| 56 | return false |
| 57 | } |
| 58 | |
| 59 | for i, k := range p.names { |
| 60 | if k == key { |
| 61 | p.names = append(p.names[:i], p.names[i+1:]...) |
| 62 | |
| 63 | break |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | delete(p.values, key) |
| 68 | |
| 69 | return true |
| 70 | } |
| 71 | |
| 72 | // Names retrieves the list of parameter names in the appropriate order. |
| 73 | func (p *Params) Names() []string { |
no outgoing calls