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

Method Add

params.go:43–51  ·  view source on GitHub ↗

Add appends a new parameter to the ordered list. If the key already exists, overwrite its value.

(k string, v interface{})

Source from the content-addressed store, hash-verified

41// Add appends a new parameter to the ordered list.
42// If the key already exists, overwrite its value.
43func (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.
54func (p *Params) Del(key string) bool {

Callers 14

TestMarshalListFunction · 0.95
TestMarshalParametersFunction · 0.95
TestParseParametersFunction · 0.95
parseParamsFunction · 0.95
TestInnerListFunction · 0.95
TestMarshalDictionnaryFunction · 0.45
TestUnmarshalDictionaryFunction · 0.45
TestMarshalFunction · 0.45
TestUnmarshalListFunction · 0.45
FuzzUnmarshalListFunction · 0.45
TestUnmarshalItemFunction · 0.45

Calls 1

assertBareItemFunction · 0.85

Tested by 13

TestMarshalListFunction · 0.76
TestMarshalParametersFunction · 0.76
TestParseParametersFunction · 0.76
TestInnerListFunction · 0.76
TestMarshalDictionnaryFunction · 0.36
TestUnmarshalDictionaryFunction · 0.36
TestMarshalFunction · 0.36
TestUnmarshalListFunction · 0.36
FuzzUnmarshalListFunction · 0.36
TestUnmarshalItemFunction · 0.36
ExampleUnmarshalListFunction · 0.36