MCPcopy
hub / github.com/go-git/go-git / Check

Method Check

internal/test/checkers.go:29–43  ·  view source on GitHub ↗
(params []interface{}, names []string)

Source from the content-addressed store, hash-verified

27}
28
29func (e errorIsChecker) Check(params []interface{}, names []string) (bool, string) {
30 obtained, ok := params[0].(error)
31 if !ok {
32 return false, "obtained is not an error"
33 }
34 expected, ok := params[1].(error)
35 if !ok {
36 return false, "expected is not an error"
37 }
38
39 if !errors.Is(obtained, expected) {
40 return false, fmt.Sprintf("obtained: %+v expected: %+v", obtained, expected)
41 }
42 return true, ""
43}

Calls 1

IsMethod · 0.80