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

Function ExampleNewCodef

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

Source from the content-addressed store, hash-verified

25}
26
27func ExampleNewCodef() {
28 err := gerror.NewCodef(gcode.New(10000, "", nil), "It's %s", "My Error")
29 fmt.Println(err.Error())
30 fmt.Println(gerror.Code(err).Code())
31
32 // Output:
33 // It's My Error
34 // 10000
35}
36
37func ExampleWrapCode() {
38 err1 := errors.New("permission denied")

Callers

nothing calls this directly

Calls 5

NewCodefFunction · 0.92
NewFunction · 0.92
CodeFunction · 0.92
ErrorMethod · 0.65
CodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…