-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
unmergeable types should panic instead of logging #160
Comments
Maybe, but it shouldn't be possible to even trigger that line. It was mainly there for development. Do you have a situation where it has actually arisen? |
Yes, I'm seeing it occur quite often. I'm away for the next few weeks but On Wednesday, 13 April 2016, David Symonds [email protected] wrote:
Cheers, Antoine Grondin Live long and prosper |
Please do. I'm not aware of any way to trigger that log line. |
Should be safe to panic then ;) On Wednesday, 13 April 2016, David Symonds [email protected] wrote:
Cheers, Antoine Grondin Live long and prosper |
The |
In https://github.com/golang/protobuf/blob/master/proto/clone.go#L204, logging the problem instead of returning-an-error/panic'ing leads to silent failures, loss of data and subtle rage inducing bugs.
Since the API would be broken if the call signature was modified to return an error, I suggest that the call panic instead of logging. This way code that incorrectly expects
proto.Merge
to merge their types would panic (and hopefully be fixed) instead of proceeding silently with corrupted state.The text was updated successfully, but these errors were encountered: