-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal
Milestone
Description
Background: it is common when working with the go/ast package to need to enumerate the list of parameter or result variables declared by a function.
Proposal: We propose to add a Variables method to ast.FieldList that returns an iterator over the sequence of variables, as defined below.
package ast // go/ast
// Variables returns an iterator over each variable declared by a FieldList.
// Each variable is represented by a (name, field) pair, where name provides
// the name (if any), and the field provides the type and position.
func (list *FieldList) Variables() iter.Seq2[*Ident, *Field]For implementation, see astutil.FlatFields in x/tools.
kwjwjimmyfrasche
Metadata
Metadata
Assignees
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal
Type
Projects
Status
Incoming