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

Function newArray

array.go:41–60  ·  view source on GitHub ↗
(parent *chain, val []interface{})

Source from the content-addressed store, hash-verified

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

Callers 11

ArrayMethod · 0.85
ArrayMethod · 0.85
NewArrayFunction · 0.85
NewArrayCFunction · 0.85
FilterMethod · 0.85
TransformMethod · 0.85
TestArray_FailedChainFunction · 0.85
TestArray_ConstructorsFunction · 0.85
KeysMethod · 0.85
ValuesMethod · 0.85
CookiesMethod · 0.85

Calls 5

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

Tested by 2

TestArray_FailedChainFunction · 0.68
TestArray_ConstructorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…