New creates and returns an error code. Note that it returns an interface object of Code.
(code int, message string, detail any)
| 53 | // New creates and returns an error code. |
| 54 | // Note that it returns an interface object of Code. |
| 55 | func New(code int, message string, detail any) Code { |
| 56 | return localCode{ |
| 57 | code: code, |
| 58 | message: message, |
| 59 | detail: detail, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // WithCode creates and returns a new error code based on given Code. |
| 64 | // The code and message is from given `code`, but the detail if from given `detail`. |
no outgoing calls