Standard library / go/doc/comment

go/doc/comment.Printer.Markdown()

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

Formal Syntax & Structure

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

Parameters & Attributes

NameTypeDescription
d*DocInput to the operation as described above.

Return Value

[]byte

Renders parsed documentation as Markdown.

Working Example

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