-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
errors: Is should not panic #54709
Comments
Change https://go.dev/cl/426174 mentions this issue: |
similiar #54708 |
Panic seems to be the right behavior, the
|
in my opinion, it's a better choice to avoid panic here. the Value.Comparable api is invented to deal with situation like this. |
Some of my thoughts Why the old version panic: This CL's problem: What to do? |
adding a Is method to Error can make it return true.
deepequal is too heavy. |
My main concern is how |
Change https://go.dev/cl/554456 mentions this issue: |
See https://github.com/golang/go/blob/master/src/reflect/deepequal.go#L154C1-L159C15 , for uncomparable types, a!=a, there are precedents. |
I think panic should be used in situations where the code should not continue to execute, such as unlocking an unlocked mutex. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
exit normaly
What did you see instead?
panic
The text was updated successfully, but these errors were encountered: