From 83bfdb6561c06bd890446af01b0f0c735360a8df Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Wed, 12 Jan 2022 09:54:19 -0500 Subject: [PATCH] go/ast: mention that FieldLists can now be enclosed by brackets Type parameter lists are stored using ast.FieldLists. Update the documentation to reflect that the enclosing delimiter may be a bracket. Change-Id: Id103e7b38975e94a1b521f75695edc10408ad3dd Reviewed-on: https://go-review.googlesource.com/c/go/+/378014 Trust: Robert Findley Run-TryBot: Robert Findley Reviewed-by: Robert Griesemer TryBot-Result: Gopher Robot --- src/go/ast/ast.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/go/ast/ast.go b/src/go/ast/ast.go index bc140473d5..a74a827c8f 100644 --- a/src/go/ast/ast.go +++ b/src/go/ast/ast.go @@ -224,11 +224,12 @@ func (f *Field) End() token.Pos { return token.NoPos } -// A FieldList represents a list of Fields, enclosed by parentheses or braces. +// A FieldList represents a list of Fields, enclosed by parentheses, +// curly braces, or square brackets. type FieldList struct { - Opening token.Pos // position of opening parenthesis/brace, if any + Opening token.Pos // position of opening parenthesis/brace/bracket, if any List []*Field // field list; or nil - Closing token.Pos // position of closing parenthesis/brace, if any + Closing token.Pos // position of closing parenthesis/brace/bracket, if any } func (f *FieldList) Pos() token.Pos { -- 2.50.0