-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(*) enforce use of correct errors module #2624
chore(*) enforce use of correct errors module #2624
Conversation
gomodguard: | ||
blocked: | ||
modules: | ||
- github.com/go-errors/errors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about just errors
module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, if there's consensus. Though it would prevent adopting APIs like errors.Is
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, do we want to block the standard errors
module? why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, do we want to block the standard
errors
module? why?
It is not blocked in this PR. The question was whether we ought to block it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we block it? We use errors.New
all the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.New
is a function from pkg/errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, we use both versions.
There are a number of Go modules named `errors` and it is easy for autocompletion to pick the wrong on, since they are all similar. Remove `github.com/go-errors/errors`, since Kuma has already standardized on `github.com/pkg/errors`. Add a linter rule to prevent regressions. Signed-off-by: James Peach <james.peach@konghq.com>
Codecov Report
@@ Coverage Diff @@
## master #2624 +/- ##
==========================================
+ Coverage 52.07% 52.09% +0.02%
==========================================
Files 877 877
Lines 49480 49480
==========================================
+ Hits 25767 25777 +10
+ Misses 21645 21633 -12
- Partials 2068 2070 +2
Continue to review full report at Codecov.
|
There are a number of Go modules named `errors` and it is easy for autocompletion to pick the wrong on, since they are all similar. Remove `github.com/go-errors/errors`, since Kuma has already standardized on `github.com/pkg/errors`. Add a linter rule to prevent regressions. Signed-off-by: James Peach <james.peach@konghq.com> Co-authored-by: Bart Smykla <bartek@smykla.com> (cherry picked from commit 975fafa) # Conflicts: # .golangci.yml # test/framework/setup.go
Summary
There are a number of Go modules named
errors
and it is easyfor autocompletion to pick the wrong on, since they are all
similar. Remove
github.com/go-errors/errors
, since Kuma hasalready standardized on
github.com/pkg/errors
. Add a linterrule to prevent regressions.
Full changelog
N/A
Issues resolved
N/A
Documentation
N/A
Testing
Backwards compatibility
backport-to-stable
label if the code is backwards compatible. Otherwise, list breaking changes.