Open pkierski opened 15 hours ago
Related Issues
Related Documentation
Related Discussions
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
this doesn't address how errors should be surfaced, see #70084 for related discussion
Also why global functions, instead of methods?
Also why global functions, instead of methods?
My bad, I've copied code from my experiments. I've thought about method ofc.
this doesn't address how errors should be surfaced, see https://github.com/golang/go/issues/70084 for related discussion
And #70631
Proposal Details
Once iterators are introduced in 1.23 there is growing number of libraries based on this feature. Reading data by lines or words are quite common task and could be accomplished with
for ... range
loop. It requires just two simple methods forbufio.Scanner
:Reading whole file as collection of lines could be like: