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

Function ExampleNewCode

errors/gerror/gerror_z_example_test.go:17–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15)
16
17func ExampleNewCode() {
18 err := gerror.NewCode(gcode.New(10000, "", nil), "My Error")
19 fmt.Println(err.Error())
20 fmt.Println(gerror.Code(err))
21
22 // Output:
23 // My Error
24 // 10000
25}
26
27func ExampleNewCodef() {
28 err := gerror.NewCodef(gcode.New(10000, "", nil), "It's %s", "My Error")

Callers

nothing calls this directly

Calls 4

NewCodeFunction · 0.92
NewFunction · 0.92
CodeFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…