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

Method Get

environment.go:132–142  ·  view source on GitHub ↗

Get returns value stored in the environment. If value does not exist, reports failure and returns nil. Example: value1 := env.Get("key1").(string) value2 := env.Get("key1").(int)

(key string)

Source from the content-addressed store, hash-verified

130// value1 := env.Get("key1").(string)
131// value2 := env.Get("key1").(int)
132func (e *Environment) Get(key string) interface{} {
133 opChain := e.chain.enter("Get(%q)", key)
134 defer opChain.leave()
135
136 e.mu.RLock()
137 defer e.mu.RUnlock()
138
139 value, _ := envValue(opChain, e.data, key)
140
141 return value
142}
143
144// GetBool returns value stored in the environment, casted to bool.
145//

Callers 12

setTypeMethod · 0.80
TestRequest_BasicAuthFunction · 0.80
HeaderMethod · 0.80
NoContentMethod · 0.80
checkContentTypeMethod · 0.80
TestEnvironment_BasicFunction · 0.80
TestEnvironment_DeleteFunction · 0.80
TestEnvironment_ClearFunction · 0.80
TestEnvironment_NotFoundFunction · 0.80
IrisHandlerFunction · 0.80

Calls 3

envValueFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80

Tested by 7

TestRequest_BasicAuthFunction · 0.64
TestEnvironment_BasicFunction · 0.64
TestEnvironment_DeleteFunction · 0.64
TestEnvironment_ClearFunction · 0.64
TestEnvironment_NotFoundFunction · 0.64