func ExampleWrapCode() {
err1 := errors.New("permission denied")
err2 := gerror.WrapCode(gcode.New(10000, "", nil), err1, "Custom Error")
fmt.Println(err2.Error())
fmt.Println(gerror.Code(err2).Code())
// Output:
// Custom Error: permission denied
// 10000
}
func ExampleWrapCodef() {
err1 := errors.New("permission denied")
err2 := gerror.WrapCodef(gcode.New(10000, "", nil), err1, "It's %s", "Custom Error")
fmt.Println(err2.Error())
fmt.Println(gerror.Code(err2).Code())
// Output:
// It's Custom Error: permission denied
// 10000
}