New returns an error with the supplied text. It's equivalent to [errors.New] followed by [Wrap] to add caller information. go:noinline due to GetCaller (see [Wrap] for details).
(text string)
| 13 | // |
| 14 | //go:noinline due to GetCaller (see [Wrap] for details). |
| 15 | func New(text string) error { |
| 16 | return wrap(errors.New(text), pc.GetCaller()) |
| 17 | } |
| 18 | |
| 19 | // Errorf creates an error message |
| 20 | // according to a format specifier |