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

Function NewSkipf

errors/gerror/gerror_api.go:44–51  ·  view source on GitHub ↗

NewSkipf returns an error that formats as the given format and args. The parameter `skip` specifies the stack callers skipped amount.

(skip int, format string, args ...any)

Source from the content-addressed store, hash-verified

42// NewSkipf returns an error that formats as the given format and args.
43// The parameter `skip` specifies the stack callers skipped amount.
44func NewSkipf(skip int, format string, args ...any) error {
45 return &Error{
46 stack: callers(skip),
47 text: format,
48 args: args,
49 code: gcode.CodeNil,
50 }
51}
52
53// Wrap wraps error with text. It returns nil if given err is nil.
54// Note that it does not lose the error code of wrapped error, as it inherits the error code from it.

Callers 2

Test_NewFunction · 0.92
Benchmark_NewSkipfFunction · 0.92

Calls 1

callersFunction · 0.85

Tested by 2

Test_NewFunction · 0.74
Benchmark_NewSkipfFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…