Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for formatDocComment (0.18 sec)

  1. src/go/printer/comment.go

    // license that can be found in the LICENSE file.
    
    package printer
    
    import (
    	"go/ast"
    	"go/doc/comment"
    	"strings"
    )
    
    // formatDocComment reformats the doc comment list,
    // returning the canonical formatting.
    func formatDocComment(list []*ast.Comment) []*ast.Comment {
    	// Extract comment text (removing comment markers).
    	var kind, text string
    	var directives []*ast.Comment
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 07:35:19 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  2. src/go/printer/printer.go

    			p.posFor(p.comment.Pos()).Column == 1 &&
    			p.posFor(p.comment.End()+1) == next {
    			// Unindented comment abutting next token position:
    			// a top-level doc comment.
    			list = formatDocComment(list)
    			changed = true
    
    			if len(p.comment.List) > 0 && len(list) == 0 {
    				// The doc comment was removed entirely.
    				// Keep preceding whitespace.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 41.6K bytes
    - Viewed (0)
Back to top