-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
By default, walker closure has the following signature:
func(i *jscan.Iterator[S]) (err bool)IDE proposes it every time you're trying to use auto-complete. And I find the named return's name quite inconvenient because of the following reasons:
errvariable is pretty common and is usually meant to carry a value of typeerror. This sometimes leads to name collisions- It doesn't quite respond to its semantics: it is more like some
exitorstop
The preferred solution would be to replace bool with the actual error interface, so jscan.Scan would return it instead of error with code ErrorCodeCallback. However, it breaks backward capability, and according to the fact that v2 was released just recently, it definitely won't be implemented just now.
So my current solution is to rename it to some of the already mentioned variants:
exitstopbreak_(seems ugly tbh)
I'm going to open a PR after the resolution
Metadata
Metadata
Assignees
Labels
No labels