MCPcopy Create free account
hub / github.com/gavv/httpexpect / newObject

Function newObject

object.go:42–61  ·  view source on GitHub ↗
(parent *chain, val map[string]interface{})

Source from the content-addressed store, hash-verified

40}
41
42func newObject(parent *chain, val map[string]interface{}) *Object {
43 o := &Object{chain: parent.clone(), value: nil}
44
45 opChain := o.chain.enter("")
46 defer opChain.leave()
47
48 if val == nil {
49 opChain.fail(AssertionFailure{
50 Type: AssertNotNil,
51 Actual: &AssertionValue{val},
52 Errors: []error{
53 errors.New("expected: non-nil map"),
54 },
55 })
56 } else {
57 o.value, _ = canonMap(opChain, val)
58 }
59
60 return o
61}
62
63// Raw returns underlying value attached to Object.
64// This is the value originally passed to NewObject, converted to canonical form.

Callers 10

ObjectMethod · 0.85
ObjectMethod · 0.85
NewObjectFunction · 0.85
NewObjectCFunction · 0.85
FilterMethod · 0.85
TransformMethod · 0.85
HeadersMethod · 0.85
FormMethod · 0.85
TestObject_FailedChainFunction · 0.85
TestObject_ConstructorsFunction · 0.85

Calls 5

canonMapFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
failMethod · 0.80
cloneMethod · 0.45

Tested by 2

TestObject_FailedChainFunction · 0.68
TestObject_ConstructorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…