Standard library / go/doc/comment

go/doc/comment.ListItem

Represents one item; Number is empty for a bullet. Expected stdout: '1\n'.

Formal Syntax & Structure

go syntaxgo
type ListItem struct {  Number string
  Content []Block}

Working Example

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