Standard library / go/doc/comment

go/doc/comment.Heading

Represents a documentation heading. Expected stdout: 'hdr-Go_Tools\n'.

Formal Syntax & Structure

go syntaxgo
type Heading struct {  Text []Text}

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc/comment")
func main() {  p := comment.Parser{}  d := p.Parse("# Go Tools")  h := d.Content[0].(*comment.Heading)  fmt.Println(h.DefaultID())}
Go Reference