MCPcopy Index your code
hub / github.com/cockroachdb/errors / TestMultiErrorUnwrap

Function TestMultiErrorUnwrap

errbase/unwrap_test.go:62–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestMultiErrorUnwrap(t *testing.T) {
63 tt := testutils.T{T: t}
64
65 err := errors.New("hello")
66 err2 := pkgErr.WithMessage(err, "woo")
67 err3 := fmt.Errorf("%w %w", err, err2)
68
69 tt.CheckEqual(errbase.UnwrapOnce(err3), nil)
70 tt.CheckEqual(errbase.UnwrapAll(err3), err3)
71 tt.CheckDeepEqual(errbase.UnwrapMulti(err3), []error{err, err2})
72}
73
74type myWrapper struct{ cause error }
75

Callers

nothing calls this directly

Calls 5

CheckEqualMethod · 0.95
CheckDeepEqualMethod · 0.95
UnwrapOnceFunction · 0.92
UnwrapAllFunction · 0.92
UnwrapMultiFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…