-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve analyzePath #39
Conversation
Allow unbalanced and nested brackets Allow nested indirects (pointer or interface{}) Fix panic on "array index is out of bounds" - return error
Hey, thanks! Sorry if this is a bother, but I think this should really be split out in three different patches:
The problem right now is that it's hard to review the full patch, since it quite large and changes three different things. We need to be sure existing behaviour isn't changed in incompatible ways, or that it doesn't break other things (there are tests, but they may not cover everything). It also makes it harder to discus the patch itself. Very quickly: 1) seems a good change, for 2) I'm a little bit worried about backwards compatibility with people who already use |
Yeah, sure, i can split it in different patches. Here are some rationale:
|
It's not really about performance but rather about complexity; I'm not really worried about 3 nanosecond of performance or whatnot. The current code is already rather complex and difficult to follow in places, and if no one is using a feature then IMHO it doesn't really make much sense in adding it. It won't really help anyone and increases maintenance burden in the future, as well as the risk of bugs in getting it wrong in edge cases and the like. In my experience, most Go libraries (including stdlib ones) don't really work with nested pointers. Unless there's an actual practical problem that this solves, I'm not so sure if we really need to add this. |
For example:
This PR fixes it:
Allow unbalanced and nested brackets
Allow nested indirects (pointer or interface{})
Fix panic on "array index is out of bounds" - return error
I will check benchmark results with these changes and post it here later