MCPcopy Index your code
hub / github.com/dunglas/httpsfv / Del

Method Del

dictionary.go:47–63  ·  view source on GitHub ↗

Del removes a member from the ordered list.

(key string)

Source from the content-addressed store, hash-verified

45
46// Del removes a member from the ordered list.
47func (d *Dictionary) Del(key string) bool {
48 if _, ok := d.values[key]; !ok {
49 return false
50 }
51
52 for i, k := range d.names {
53 if k == key {
54 d.names = append(d.names[:i], d.names[i+1:]...)
55
56 break
57 }
58 }
59
60 delete(d.values, key)
61
62 return true
63}
64
65// Names retrieves the list of member names in the appropriate order.
66func (d *Dictionary) Names() []string {

Callers 1

TestMarshalDictionnaryFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestMarshalDictionnaryFunction · 0.76