MCPcopy Index your code
hub / github.com/coder/coder / xerrors

Function xerrors

scripts/rules.go:110–127  ·  view source on GitHub ↗

Use xerrors everywhere! It provides additional stacktrace info! nolint:unused,deadcode,varnamelen

(m dsl.Matcher)

Source from the content-addressed store, hash-verified

108//
109//nolint:unused,deadcode,varnamelen
110func xerrors(m dsl.Matcher) {
111 m.Import("errors")
112 m.Import("fmt")
113 m.Import("golang.org/x/xerrors")
114
115 m.Match("fmt.Errorf($arg)").
116 Suggest("xerrors.New($arg)").
117 Report("Use xerrors to provide additional stacktrace information!")
118
119 m.Match("fmt.Errorf($arg1, $*args)").
120 Suggest("xerrors.Errorf($arg1, $args)").
121 Report("Use xerrors to provide additional stacktrace information!")
122
123 m.Match("errors.$_($msg)").
124 Where(m["msg"].Type.Is("string")).
125 Suggest("xerrors.New($msg)").
126 Report("Use xerrors to provide additional stacktrace information!")
127}
128
129// databaseImport enforces not importing any database types into /codersdk.
130//

Callers

nothing calls this directly

Calls 3

MatchMethod · 0.80
ReportMethod · 0.65
IsMethod · 0.45

Tested by

no test coverage detected