Open
Description
Proposal Details
In Go 1.23, we can use range-over-func a.k.a iterator and developers propose to apply for the package into some packages.
For instance, the following issues are easy to know what kind of content are proposed.
#61897
#64341
This proposal is similar with above it.
I think it's good to apply for archive/tar, too.
func (tr *Reader) NextIter() iter.Seq2[*Header, error] {
return func(yield func(*Header, error) bool) {
hdr, err := tr.Next()
if err == io.EOF {
return
}
if !yield(hdr, err) {
return
}
}
}
Thanks.
Metadata
Metadata
Assignees
Type
Projects
Status
Incoming