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
refactor: replace deprecated errors module in src #12729
refactor: replace deprecated errors module in src #12729
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
d2188d3
to
d43fb8a
Compare
d43fb8a
to
2e2469a
Compare
2e2469a
to
5a6f899
Compare
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.
LGTM, except for the one non-documented resolution.
@@ -258,7 +258,7 @@ func TestNewConfigManager_DefaultNotFound(t *testing.T) { | |||
|
|||
cm := NewConfigManager() | |||
err := LoadConfigFile(cm, filepath.Join("testdata", "doesnotexist.json")) | |||
assert.True(t, os.IsNotExist(errors.Cause(err))) | |||
assert.True(t, os.IsNotExist(errors.Unwrap(err))) |
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.
This is not discussed in #12632, can you add 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.
I added a bullet point to the list in my comment there.
5a6f899
to
686afbf
Compare
Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Also update go.mod file Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
686afbf
to
63a7be4
Compare
* refactor(src): Replaces errors.Wrap[f] with fmt.Errorf. Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com> * refactor(src): Replaces more pkg/errors usages with std lib. Also update go.mod file Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
* refactor(src): Replaces errors.Wrap[f] with fmt.Errorf. Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com> * refactor(src): Replaces more pkg/errors usages with std lib. Also update go.mod file Signed-off-by: Moritz Huebner <moritz.huebner@tngtech.com>
Summary
See #12632 for description
Remove dependency on "github.com/pkg/errors"
errors.Wrap[f]
withfmt.Errorf
errors.New
with standard liberrors.New
errors.Cause
with standard liberrors.Unwrap
Test Plan
Run unit tests
Additional Information
Worked in pairing with @wolfseb