Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9473f84

Browse files
deansheatherpull[bot]
authored andcommitted
chore: fix ruleguard xerrors rules (#8967)
1 parent33d747d commit9473f84

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

‎cli/stat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (*RootCmd) statDisk(s *clistat.Statter) *clibase.Cmd {
240240
ds,err:=s.Disk(pfx,pathArg)
241241
iferr!=nil {
242242
ifos.IsNotExist(err) {
243-
// fmt.Errorf produces a more concise error.
243+
//nolint:gocritic // fmt.Errorf produces a more concise error.
244244
returnfmt.Errorf("not found: %q",pathArg)
245245
}
246246
returnerr

‎scripts/rules.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ func xerrors(m dsl.Matcher) {
5151
m.Import("fmt")
5252
m.Import("golang.org/x/xerrors")
5353

54-
m.Match("fmt.Errorf($*args)").
55-
Suggest("xerrors.New($args)").
54+
m.Match("fmt.Errorf($arg)").
55+
Suggest("xerrors.New($arg)").
56+
Report("Use xerrors to provide additional stacktrace information!")
57+
58+
m.Match("fmt.Errorf($arg1, $*args)").
59+
Suggest("xerrors.Errorf($arg1, $args)").
5660
Report("Use xerrors to provide additional stacktrace information!")
5761

5862
m.Match("errors.$_($msg)").

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp