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

Function Wrap5

wrap.go:76–82  ·  view source on GitHub ↗

Wrap5 is used to [Wrap] the last error return when returning 5 values. This is useful when returning multiple returns from a function call directly: return Wrap5(fn()) Wrap5 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, t4 T4, err error)

Source from the content-addressed store, hash-verified

74//
75//go:noinline due to GetCaller (see [Wrap] for details).
76func Wrap5[T1, T2, T3, T4 any](t1 T1, t2 T2, t3 T3, t4 T4, err error) (T1, T2, T3, T4, error) {
77 if err == nil {
78 return t1, t2, t3, t4, nil
79 }
80
81 return t1, t2, t3, t4, wrap(err, pc.GetCaller())
82}
83
84// Wrap6 is used to [Wrap] the last error return when returning 6 values.
85// 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