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

Method Clear

environment.go:96–104  ·  view source on GitHub ↗

Clear will delete all key value pairs from the environment Example: env := NewEnvironment(t) env.Put("key1", 123) env.Put("key2", 456) env.Clear()

()

Source from the content-addressed store, hash-verified

94// env.Put("key2", 456)
95// env.Clear()
96func (e *Environment) Clear() {
97 opChain := e.chain.enter("Clear()")
98 defer opChain.leave()
99
100 e.mu.Lock()
101 defer e.mu.Unlock()
102
103 e.data = make(map[string]interface{})
104}
105
106// Has returns true if value exists in the environment.
107//

Callers 1

TestEnvironment_ClearFunction · 0.80

Calls 4

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

Tested by 1

TestEnvironment_ClearFunction · 0.64