Standard library / go/doc/comment

go/doc/comment.Printer.Text()

Renders parsed documentation as plain text. Expected stdout: 'Hello\n'.

Formal Syntax & Structure

go syntaxgo
func (p *Printer) Text(d *Doc) []byte

Parameters & Attributes

NameTypeDescription
d*DocInput to the operation as described above.

Return Value

[]byte

Renders parsed documentation as plain text.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc/comment")
func main() {  p := comment.Parser{}  pr := comment.Printer{}  fmt.Print(string(pr.Text(p.Parse("Hello"))))}
Go Reference