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

Function Wrap4

wrap.go:60–66  ·  view source on GitHub ↗

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

(t1 T1, t2 T2, t3 T3, err error)

Source from the content-addressed store, hash-verified

58//
59//go:noinline due to GetCaller (see [Wrap] for details).
60func Wrap4[T1, T2, T3 any](t1 T1, t2 T2, t3 T3, err error) (T1, T2, T3, error) {
61 if err == nil {
62 return t1, t2, t3, nil
63 }
64
65 return t1, t2, t3, wrap(err, pc.GetCaller())
66}
67
68// Wrap5 is used to [Wrap] the last error return when returning 5 values.
69// 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