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

Function Newf

errors/gerror/gerror_api.go:23–30  ·  view source on GitHub ↗

Newf returns an error that formats as the given format and args.

(format string, args ...any)

Source from the content-addressed store, hash-verified

21
22// Newf returns an error that formats as the given format and args.
23func Newf(format string, args ...any) error {
24 return &Error{
25 stack: callers(),
26 text: format,
27 args: args,
28 code: gcode.CodeNil,
29 }
30}
31
32// NewSkip creates and returns an error which is formatted from given text.
33// The parameter `skip` specifies the stack callers skipped amount.

Callers 15

HandleResponseMethod · 0.92
loadContentWithOptionsFunction · 0.92
mappingAndFilterDataMethod · 0.92
GetFieldsExStrMethod · 0.92
sliceTypeConverterFuncFunction · 0.92
NewAdapterFileFunction · 0.92
doScanDirFunction · 0.92
getConnByPidFunction · 0.92
getCommPidFolderPathFunction · 0.92
StructTypeFunction · 0.92
doAddCommandMethod · 0.92
NewFromObjectFunction · 0.92

Calls 1

callersFunction · 0.85

Tested by 4

Test_NewFunction · 0.74
Test_TextArgsFunction · 0.74
Benchmark_NewfFunction · 0.74
RuleUserCreateReqFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…