MCPcopy Index your code
hub / github.com/gavv/httpexpect / Put

Method Put

environment.go:61–69  ·  view source on GitHub ↗

Put saves the value with key in the environment. Example: env := NewEnvironment(t) env.Put("key1", "str") env.Put("key2", 123)

(key string, value interface{})

Source from the content-addressed store, hash-verified

59// env.Put("key1", "str")
60// env.Put("key2", 123)
61func (e *Environment) Put(key string, value interface{}) {
62 opChain := e.chain.enter("Put(%q)", key)
63 defer opChain.leave()
64
65 e.mu.Lock()
66 defer e.mu.Unlock()
67
68 e.data[key] = value
69}
70
71// Delete removes the value with key from the environment.
72//

Callers 15

TestEnvironment_BasicFunction · 0.80
TestEnvironment_DeleteFunction · 0.80
TestEnvironment_ClearFunction · 0.80
TestEnvironment_BoolFunction · 0.80
TestEnvironment_IntFunction · 0.80
TestEnvironment_FloatFunction · 0.80
TestEnvironment_StringFunction · 0.80
TestEnvironment_BytesFunction · 0.80
TestEnvironment_DurationFunction · 0.80
TestEnvironment_TimeFunction · 0.80
TestEnvironment_ListFunction · 0.80

Calls 4

enterMethod · 0.80
leaveMethod · 0.80
LockMethod · 0.80
UnlockMethod · 0.80

Tested by 15

TestEnvironment_BasicFunction · 0.64
TestEnvironment_DeleteFunction · 0.64
TestEnvironment_ClearFunction · 0.64
TestEnvironment_BoolFunction · 0.64
TestEnvironment_IntFunction · 0.64
TestEnvironment_FloatFunction · 0.64
TestEnvironment_StringFunction · 0.64
TestEnvironment_BytesFunction · 0.64
TestEnvironment_DurationFunction · 0.64
TestEnvironment_TimeFunction · 0.64
TestEnvironment_ListFunction · 0.64