MCPcopy Index your code
hub / github.com/bracesdev/errtrace / Wrap3

Function Wrap3

wrap.go:44–50  ·  view source on GitHub ↗

Wrap3 is used to [Wrap] the last error return when returning 3 values. This is useful when returning multiple returns from a function call directly: return Wrap3(fn()) Wrap3 is used by the CLI to avoid line number changes. go:noinline due to GetCaller (see [Wrap] for details).

(t1 T1, t2 T2, err error)

Source from the content-addressed store, hash-verified

42//
43//go:noinline due to GetCaller (see [Wrap] for details).
44func Wrap3[T1, T2 any](t1 T1, t2 T2, err error) (T1, T2, error) {
45 if err == nil {
46 return t1, t2, nil
47 }
48
49 return t1, t2, wrap(err, pc.GetCaller())
50}
51
52// Wrap4 is used to [Wrap] the last error return when returning 4 values.
53// This is useful when returning multiple returns from a function call directly:

Callers 1

TestWrap_LineFunction · 0.92

Calls 2

GetCallerFunction · 0.92
wrapFunction · 0.70

Tested by 1

TestWrap_LineFunction · 0.74