Skip to content

proposal: reflect: add Type.CanSeq0 and Value.Seq0Β #77692

@rothelius

Description

@rothelius

Proposal Details

It is possible to range over expressions of type func(func()bool) (and similar), but there's no simple way to test whether a given type allows range-variable-less ranging, or to perform a range over a reflect.Value of such a type.

Methods reflect.Type.CanSeq0 and reflect.Value.Seq0, implemented in the manner of corresponding Seq and Seq2 methods, would solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions