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
Describe the solution you'd like
Go 1.23 introduced the ability to use iterators for looping through custom structs. The above code could look like this, if we introduce iterator functions to pdata, e.g. Seq() and Seq2():
I think this is a perfect use case for iterators, the way this is implemented today is quite verbose to write and almost every single use case requires looping over the entries in some way.
I suggest we go with an All method, following the api signature for the already existing maps and slices counterparts.
Since this involves changes in autogenerated code, there might be oportunities for reusing existing iterator routines from the standard library, for example ResourceSpans uses an slice internally.
Is your feature request related to a problem? Please describe.
Iterating through
pdata
structures today is pretty convoluted, e.g.Describe the solution you'd like
Go 1.23 introduced the ability to use iterators for looping through custom structs. The above code could look like this, if we introduce iterator functions to pdata, e.g.
Seq()
andSeq2()
:The text was updated successfully, but these errors were encountered: