type go/ast.CommentGroup
80 uses
go/ast (current package)
ast.go#L78: type CommentGroup struct {
ast.go#L82: func (g *CommentGroup) Pos() token.Pos { return g.List[0].Pos() }
ast.go#L83: func (g *CommentGroup) End() token.Pos { return g.List[len(g.List)-1].End() }
ast.go#L101: func (g *CommentGroup) Text() string {
ast.go#L202: Doc *CommentGroup // associated documentation; or nil
ast.go#L206: Comment *CommentGroup // line comments; or nil
ast.go#L910: Doc *CommentGroup // associated documentation; or nil
ast.go#L913: Comment *CommentGroup // line comments; or nil
ast.go#L921: Doc *CommentGroup // associated documentation; or nil
ast.go#L925: Comment *CommentGroup // line comments; or nil
ast.go#L930: Doc *CommentGroup // associated documentation; or nil
ast.go#L935: Comment *CommentGroup // line comments; or nil
ast.go#L996: Doc *CommentGroup // associated documentation; or nil
ast.go#L1006: Doc *CommentGroup // associated documentation; or nil
ast.go#L1065: Doc *CommentGroup // associated documentation; or nil
ast.go#L1074: Comments []*CommentGroup // comments in the file, in lexical order
commentmap.go#L17: func sortComments(list []*CommentGroup) {
commentmap.go#L18: slices.SortFunc(list, func(a, b *CommentGroup) int {
commentmap.go#L26: type CommentMap map[Node][]*CommentGroup
commentmap.go#L28: func (cmap CommentMap) addComment(n Node, c *CommentGroup) {
commentmap.go#L31: list = []*CommentGroup{c}
commentmap.go#L44: case nil, *CommentGroup, *Comment:
commentmap.go#L69: list []*CommentGroup
commentmap.go#L71: comment *CommentGroup // comment group at current index
commentmap.go#L127: func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap {
commentmap.go#L135: tmp := make([]*CommentGroup, len(comments))
commentmap.go#L253: func (cmap CommentMap) Comments() []*CommentGroup {
commentmap.go#L254: list := make([]*CommentGroup, 0, len(cmap))
commentmap.go#L262: func summary(list []*CommentGroup) string {
filter.go#L380: var doc *CommentGroup
filter.go#L405: doc = &CommentGroup{list}
filter.go#L497: var comments []*CommentGroup
filter.go#L499: comments = make([]*CommentGroup, ncomments)
import.go#L109: cg *CommentGroup
import.go#L156: var comments []*CommentGroup
import.go#L242: slices.SortFunc(comments, func(a, b *CommentGroup) int {
walk.go#L46: case *CommentGroup:
go/build
build.go#L1430: doc *ast.CommentGroup
build.go#L1697: func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup) error {
go/doc
example.go#L28: Comments []*ast.CommentGroup
example.go#L119: func exampleOutput(b *ast.BlockStmt, comments []*ast.CommentGroup) (output string, unordered, ok bool) {
example.go#L263: var comments []*ast.CommentGroup
example.go#L318: slices.SortFunc(comments, func(a, b *ast.CommentGroup) int {
example.go#L575: func stripOutputComment(body *ast.BlockStmt, comments []*ast.CommentGroup) (*ast.BlockStmt, []*ast.CommentGroup) {
example.go#L588: newComments := make([]*ast.CommentGroup, len(comments)-1)
example.go#L595: func lastComment(b *ast.BlockStmt, c []*ast.CommentGroup) (i int, last *ast.CommentGroup) {
reader.go#L244: func (r *reader) readDoc(comment *ast.CommentGroup) {
reader.go#L519: text := (&ast.CommentGroup{List: list}).Text()
reader.go#L543: func (r *reader) readNotes(comments []*ast.CommentGroup) {
go/parser
parser.go#L49: comments []*ast.CommentGroup
parser.go#L50: leadComment *ast.CommentGroup // last lead comment
parser.go#L51: lineComment *ast.CommentGroup // last line comment
parser.go#L208: func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {
parser.go#L218: comments = &ast.CommentGroup{List: list}
parser.go#L245: var comment *ast.CommentGroup
parser.go#L353: func (p *parser) expectSemi() (comment *ast.CommentGroup) {
parser.go#L2507: type parseSpecFunction func(doc *ast.CommentGroup, keyword token.Token, iota int) ast.Spec
parser.go#L2509: func (p *parser) parseImportSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
parser.go#L2551: func (p *parser) parseValueSpec(doc *ast.CommentGroup, keyword token.Token, iota int) ast.Spec {
parser.go#L2608: func (p *parser) parseTypeSpec(doc *ast.CommentGroup, _ token.Token, _ int) ast.Spec {
go/printer
nodes.go#L67: func (p *printer) setComment(g *ast.CommentGroup) {
nodes.go#L73: p.comments = make([]*ast.CommentGroup, 1)
nodes.go#L490: p.setComment(&ast.CommentGroup{List: []*ast.Comment{{Slash: token.NoPos, Text: text}}})
printer.go#L49: comment *ast.CommentGroup // = printer.comments[cindex-1]; or nil
printer.go#L85: comments []*ast.CommentGroup // may be nil
printer.go#L1049: func getDoc(n ast.Node) *ast.CommentGroup {
printer.go#L1069: func getLastComment(n ast.Node) *ast.CommentGroup {
printer.go#L1093: var comments []*ast.CommentGroup
printer.go#L1416: Comments []*ast.CommentGroup
go.pact.im/x/plumb/internal/discover
discover.go#L29: func directiveNames(doc *ast.CommentGroup, fset *token.FileSet) ([]string, *diag.Error) {
discover.go#L39: func appendDirectiveNames(prior []string, doc *ast.CommentGroup, fset *token.FileSet) ([]string, *diag.Error) {
discover.go#L202: func collectProviderDocs(file *ast.File) map[*ast.CommentGroup]bool {
discover.go#L203: read := make(map[*ast.CommentGroup]bool)
discover.go#L204: mark := func(cg *ast.CommentGroup) {
discover.go#L250: func specDirectiveNames(gd *ast.GenDecl, specDoc *ast.CommentGroup, fset *token.FileSet) ([]string, *diag.Error) {
golang.org/x/tools/go/ast/edge
edge.go#L210: CommentGroup_List: info[*ast.CommentGroup]("List"),
golang.org/x/tools/go/ast/inspector
typeof.go#L130: case *ast.CommentGroup:
walk.go#L36: case *ast.CommentGroup: