You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever you try to dereference a nil pointer in Go, you get a helpful panic message that includes the line number that the attempted dereference occurred.
Sometimes however the expression where the dereference occurs has multiple access points and it can sometimes be hard to know which of them is the nil pointer.
If you have an expression like;
and that leads to a panic, it is reasonable to assume that product is the nil pointer.
But in an expression like;
each one of person, product, country or location could have been the nil pointer.
It would be helpful if in such circumstances the panic message included the column/offset number as well so that you can know which field(access point) is nil.
I've wanted something like this for a number of years and always felt like maybe it is too hard to implement. I've already encountered the need for it twice already this year; so I thought it wouldn't hurt to ask.
Instead of reporting panic error messages like this:
The compiler has this data (added as part of #10324), so it could in principle encode it into the pcln tables in the binary.
I don't think we have a good feel for how expensive this would be. My feeling is it might be pretty expensive, but there's no real way to know without a prototype.