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)
| 42 | // |
| 43 | //go:noinline due to GetCaller (see [Wrap] for details). |
| 44 | func 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: |