MCPcopy
hub / github.com/gogf/gf / New

Function New

errors/gcode/gcode.go:55–61  ·  view source on GitHub ↗

New creates and returns an error code. Note that it returns an interface object of Code.

(code int, message string, detail any)

Source from the content-addressed store, hash-verified

53// New creates and returns an error code.
54// Note that it returns an interface object of Code.
55func 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`.

Callers 15

HandleResponseMethod · 0.92
UnaryErrorMethod · 0.92
UnaryRecoverMethod · 0.92
UnaryValidateMethod · 0.92
ExampleNewCodeFunction · 0.92
ExampleNewCodefFunction · 0.92
ExampleWrapCodeFunction · 0.92
ExampleWrapCodefFunction · 0.92
Test_CodeFunction · 0.92
Benchmark_NewCodeFunction · 0.92
Benchmark_NewCodefFunction · 0.92
Benchmark_NewCodeSkipFunction · 0.92

Calls

no outgoing calls

Tested by 14

ExampleNewCodeFunction · 0.74
ExampleNewCodefFunction · 0.74
ExampleWrapCodeFunction · 0.74
ExampleWrapCodefFunction · 0.74
Test_CodeFunction · 0.74
Benchmark_NewCodeFunction · 0.74
Benchmark_NewCodefFunction · 0.74
Benchmark_NewCodeSkipFunction · 0.74
Benchmark_NewCodeSkipfFunction · 0.74
Benchmark_WrapCodeFunction · 0.74
Benchmark_WrapCodefFunction · 0.74
Test_NilFunction · 0.74