Skip to content

Commit

Permalink
fix: ignore .WithStack and .WithMessagef from github.com/pkg/erro…
Browse files Browse the repository at this point in the history
…rs (#15)
  • Loading branch information
r2k1 authored Jun 15, 2021
1 parent 5a99e6a commit 56ecd1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ignoreSigs:
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
```
## Usage
Expand Down
10 changes: 9 additions & 1 deletion wrapcheck/testdata/ignore_pkg_errors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@ func do() error {
return errors.WithMessage(err, "uh oh")
}

return nil
if err != nil {
return errors.WithMessagef(err, "uh %s", "oh")
}

if err != nil {
return errors.WithStack(err)
}

return errors.New("uh oh")
}
2 changes: 2 additions & 0 deletions wrapcheck/wrapcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var DefaultIgnoreSigs = []string{
".Wrap(",
".Wrapf(",
".WithMessage(",
".WithMessagef(",
".WithStack(",
}

// WrapcheckConfig is the set of configuration values which configure the
Expand Down

0 comments on commit 56ecd1e

Please sign in to comment.