-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Follow recommended Go 1.13 error handling guidelines #1846
Comments
I would like to work on this issue. |
Thank you, @mbalayil ! It is yours. |
There are 6 places in
where However for the rest of the 5 instances where
Which method is preferred ? Or is there another alternative ? |
My opinion is to implement |
Can I use github.com/google/go-cmp for the implementation of the |
Do you have a link? I'm not seeing any Shouldn't it be as simple as this:
and then it would be used like this:
or am I missing something? |
Isn't If so, |
That makes sense. Sounds good, @willnorris . |
Will update a PR soon with these partial fixes. |
Hi @mbalayil - go ahead and provide a PR with your proposed solution (using |
"It is intended to only be used in tests, as performance is not a goal and it may panic if it cannot compare the values. Its propensity towards panicking means that its unsuitable for production environments where a spurious panic may be fatal." In https://pkg.go.dev/github.com/google/go-cmp/cmp#pkg-overview, it is mentioned that this package is better not used in production code. So I have created the PR by directly comparing the values. However, for the Apologies for the delay. It took me some time to figure all this out. |
That makes sense to me. Let's try this out unless we hear other feedback. |
In a recent code review, we felt that this repo should use the recommended Go 1.13 error handling guidelines.
Specifically, we should never use
reflect.DeepEqual
for checking errors (even in tests) and would ideally use the "new"error.Is
functionality provided in Go 1.13.Additionally, we should update the README.md to reflect that it is no longer Go 1.9 that we require, but instead we need a minimum of Go 1.13.
The text was updated successfully, but these errors were encountered: