Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (*RootCmd) statDisk(s *clistat.Statter) *clibase.Cmd {
ds, err := s.Disk(pfx, pathArg)
if err != nil {
if os.IsNotExist(err) {
// fmt.Errorf produces a more concise error.
//nolint:gocritic // fmt.Errorf produces a more concise error.
return fmt.Errorf("not found: %q", pathArg)
}
return err
Expand Down
8 changes: 6 additions & 2 deletions scripts/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ func xerrors(m dsl.Matcher) {
m.Import("fmt")
m.Import("golang.org/x/xerrors")

m.Match("fmt.Errorf($*args)").
Suggest("xerrors.New($args)").
m.Match("fmt.Errorf($arg)").
Suggest("xerrors.New($arg)").
Report("Use xerrors to provide additional stacktrace information!")

m.Match("fmt.Errorf($arg1, $*args)").
Suggest("xerrors.Errorf($arg1, $args)").
Report("Use xerrors to provide additional stacktrace information!")

m.Match("errors.$_($msg)").
Expand Down