type go/ast.Comment
18 uses
go/ast (current package)
ast.go#L65: type Comment struct {
ast.go#L70: func (c *Comment) Pos() token.Pos { return c.Slash }
ast.go#L71: func (c *Comment) End() token.Pos { return token.Pos(int(c.Slash) + len(c.Text)) }
ast.go#L77: List []*Comment // len(List) > 0
commentmap.go#L63: case nil, *CommentGroup, *Comment:
filter.go#L339: var separator = &Comment{token.NoPos, "//"}
filter.go#L371: list := make([]*Comment, ndocs-1) // -1: no separator before first group
walk.go#L61: case *Comment:
go/doc
reader.go#L504: func (r *reader) readNote(list []*ast.Comment) {
go/parser
parser.go#L134: func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
parser.go#L147: comment = &ast.Comment{Slash: p.pos, Text: p.lit}
parser.go#L159: var list []*ast.Comment
parser.go#L162: var comment *ast.Comment
go/printer
nodes.go#L475: p.setComment(&ast.CommentGroup{List: []*ast.Comment{{Slash: token.NoPos, Text: text}}})
printer.go#L118: func (p *printer) commentsHaveNewline(list []*ast.Comment) bool {
printer.go#L356: func (p *printer) writeCommentPrefix(pos, next token.Position, prev *ast.Comment, tok token.Token) {
printer.go#L638: func (p *printer) writeComment(comment *ast.Comment) {
printer.go#L749: var last *ast.Comment