MCPcopy
hub / github.com/stretchr/testify / Error

Method Error

mock/mock.go:1120–1131  ·  view source on GitHub ↗

Error gets the argument at the specified index. Panics if there is no argument, or if the argument is of the wrong type.

(index int)

Source from the content-addressed store, hash-verified

1118// Error gets the argument at the specified index. Panics if there is no argument, or
1119// if the argument is of the wrong type.
1120func (args Arguments) Error(index int) error {
1121 obj := args.Get(index)
1122 var s error
1123 var ok bool
1124 if obj == nil {
1125 return nil
1126 }
1127 if s, ok = obj.(error); !ok {
1128 panic(fmt.Sprintf("assert: arguments: Error(%d) failed because object wasn't correct type: %v", index, obj))
1129 }
1130 return s
1131}
1132
1133// Bool gets the argument at the specified index. Panics if there is no argument, or
1134// if the argument is of the wrong type.

Callers 15

TestImportsFunction · 0.45
Test_A_FailsMethod · 0.45
RoundTripMethod · 0.45
TheExampleMethod3Method · 0.45
TheExampleMethod4Method · 0.45
TheExampleMethod5Method · 0.45
TheExampleMethod6Method · 0.45
TheExampleMethod7Method · 0.45
TheExampleMethodFuncMethod · 0.45

Calls 1

GetMethod · 0.95

Tested by 15

TestImportsFunction · 0.36
Test_A_FailsMethod · 0.36
TheExampleMethod3Method · 0.36
TheExampleMethod4Method · 0.36
TheExampleMethod5Method · 0.36
TheExampleMethod6Method · 0.36
TheExampleMethod7Method · 0.36
TheExampleMethodFuncMethod · 0.36