Standard library / go/doc/comment

go/doc/comment.List

Represents a nonempty numbered or bullet list. Expected stdout: '2\n'.

Formal Syntax & Structure

go syntaxgo
type List struct {  Items []*ListItem
  ForceBlankBefore bool
  ForceBlankBetween bool}

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc/comment")
func main() {  p := comment.Parser{}  d := p.Parse("Items:\n\n - first\n - second\n")  l := d.Content[1].(*comment.List)  fmt.Println(len(l.Items))}
Go Reference