Documentation
¶
Overview ¶
Package ast defines AST nodes that represent markdown elements.
Index ¶
- Variables
- func IsParagraph(node Node) bool
- func Walk(n Node, walker Walker) error
- func WithLinkTitle(title textm.MultiLineValue) interface{ ... }
- type Attribute
- type AutoLink
- type AutoLinkOption
- type BaseBlock
- type BaseInline
- type BaseNode
- func (n *BaseNode) AppendChild(v Node)
- func (n *BaseNode) Attribute(name string) (textm.MultiLineValue, bool)
- func (n *BaseNode) Attributes() []Attribute
- func (n *BaseNode) ChildCount() int
- func (n *BaseNode) Children() iter.Seq[Node]
- func (n *BaseNode) FirstChild() Node
- func (n *BaseNode) HasChildren() bool
- func (n *BaseNode) Init(self Node)
- func (n *BaseNode) InsertAfter(target, insertee Node)
- func (n *BaseNode) InsertBefore(target, insertee Node)
- func (n *BaseNode) LastChild() Node
- func (n *BaseNode) NextSibling() Node
- func (n *BaseNode) OwnerDocument() *Document
- func (n *BaseNode) Parent() Node
- func (n *BaseNode) Pos() int
- func (n *BaseNode) PreviousSibling() Node
- func (n *BaseNode) RemoveAttributes()
- func (n *BaseNode) RemoveChild(v Node)
- func (n *BaseNode) RemoveChildren()
- func (n *BaseNode) ReplaceChild(target, insertee Node)
- func (n *BaseNode) SetAttribute(name string, value textm.MultiLineValue)
- func (n *BaseNode) SetNextSibling(v Node)
- func (n *BaseNode) SetParent(v Node)
- func (n *BaseNode) SetPos(v int)
- func (n *BaseNode) SetPreviousSibling(v Node)
- type BlockNode
- type Blockquote
- type CodeBlock
- type CodeBlockKind
- type CodeBlockOption
- type CodeSpan
- type Document
- type Emphasis
- type HTMLBlock
- type HTMLBlockKind
- type Heading
- type HeadingKind
- type Image
- type InlineNode
- type Link
- type LinkOption
- type LinkReferenceDefinition
- type LinkReferenceDefinitionOption
- type List
- type ListItem
- type Node
- type NodeDump
- type NodeKind
- type Paragraph
- type PrettyPrintOption
- type RawHTML
- type ReferenceLink
- type ReferenceLinkKind
- type Strong
- type Text
- type ThematicBreak
- type WalkStatus
- type Walker
Constants ¶
This section is empty.
Variables ¶
var KindAutoLink = NewNodeKind("AutoLink")
KindAutoLink is a NodeKind of the AutoLink node.
var KindBlockquote = NewNodeKind("Blockquote")
KindBlockquote is a NodeKind of the Blockquote node.
var KindCodeBlock = NewNodeKind("CodeBlock")
KindCodeBlock is a NodeKind of the CodeBlock node.
var KindCodeSpan = NewNodeKind("CodeSpan")
KindCodeSpan is a NodeKind of the CodeSpan node.
var KindDocument = NewNodeKind("Document")
KindDocument is a NodeKind of the Document node.
var KindEmphasis = NewNodeKind("Emphasis")
KindEmphasis is a NodeKind of the Emphasis node.
var KindHTMLBlock = NewNodeKind("HTMLBlock")
KindHTMLBlock is a NodeKind of the HTMLBlock node.
var KindHeading = NewNodeKind("Heading")
KindHeading is a NodeKind of the Heading node.
var KindImage = NewNodeKind("Image")
KindImage is a NodeKind of the Image node.
var KindLink = NewNodeKind("Link")
KindLink is a NodeKind of the Link node.
var KindLinkReferenceDefinition = NewNodeKind("LinkReferenceDefinition")
KindLinkReferenceDefinition is a NodeKind of the LinkReferenceDefinition node.
var KindList = NewNodeKind("List")
KindList is a NodeKind of the List node.
var KindListItem = NewNodeKind("ListItem")
KindListItem is a NodeKind of the ListItem node.
var KindParagraph = NewNodeKind("Paragraph")
KindParagraph is a NodeKind of the Paragraph node.
var KindRawHTML = NewNodeKind("RawHTML")
KindRawHTML is a NodeKind of the RawHTML node.
var KindStrong = NewNodeKind("Strong")
KindStrong is a NodeKind of the Strong node.
var KindText = NewNodeKind("Text")
KindText is a NodeKind of the Text node.
var KindThematicBreak = NewNodeKind("ThematicBreak")
KindThematicBreak is a NodeKind of the ThematicBreak node.
Functions ¶
func IsParagraph ¶
IsParagraph returns true if the given node is a Paragraph node, otherwise false.
func WithLinkTitle ¶
func WithLinkTitle(title textm.MultiLineValue) interface { LinkOption LinkReferenceDefinitionOption }
WithLinkTitle returns a LinkOption that sets the title of a link or image.
Types ¶
type Attribute ¶
type Attribute struct {
Name string
Value textm.MultiLineValue
}
An Attribute is an attribute of the Node.
type AutoLink ¶
type AutoLink struct {
BaseInline
// Destination is the URL used for the href attribute.
// For email autolinks, it includes the "mailto:" prefix.
Destination textm.SingleLineValue
// Label is the display text shown inside the link element.
Label textm.SingleLineValue
// Text is the original text as parsed from source, including any
// surrounding syntax characters (e.g. "<" and ">" for CommonMark autolinks).
Text textm.SingleLineValue
}
An AutoLink struct represents an autolink of the Markdown text.
func NewAutoLink ¶
func NewAutoLink(destination, label textm.SingleLineValue, opts ...AutoLinkOption) *AutoLink
NewAutoLink returns a new AutoLink node with the given destination, label, and options.
type AutoLinkOption ¶
type AutoLinkOption interface {
// contains filtered or unexported methods
}
AutoLinkOption is an option for AutoLink nodes.
func WithAutoLinkText ¶
func WithAutoLinkText(text textm.SingleLineValue) AutoLinkOption
WithAutoLinkText returns an AutoLinkOption that sets the original source text of an autolink.
type BaseBlock ¶
type BaseBlock struct {
BaseNode
// contains filtered or unexported fields
}
A BaseBlock struct implements the Node interface partially.
func (*BaseBlock) AppendSource ¶
AppendSource implements BlockNode.AppendSource.
func (*BaseBlock) HasBlankPreviousLines ¶
HasBlankPreviousLines implements Node.HasBlankPreviousLines.
func (*BaseBlock) SetBlankPreviousLines ¶
SetBlankPreviousLines implements Node.SetBlankPreviousLines.
type BaseInline ¶
type BaseInline struct {
BaseNode
}
A BaseInline struct implements the Node interface partially.
type BaseNode ¶
type BaseNode struct {
// contains filtered or unexported fields
}
A BaseNode struct implements the Node interface partially.
func (*BaseNode) AppendChild ¶
AppendChild implements Node.AppendChild .
func (*BaseNode) Attribute ¶
func (n *BaseNode) Attribute(name string) (textm.MultiLineValue, bool)
Attribute implements Node.Attribute.
func (*BaseNode) Attributes ¶
Attributes implements Node.Attributes.
func (*BaseNode) ChildCount ¶
ChildCount implements Node.ChildCount .
func (*BaseNode) FirstChild ¶
FirstChild implements Node.FirstChild .
func (*BaseNode) HasChildren ¶
HasChildren implements Node.HasChildren .
func (*BaseNode) InsertAfter ¶
InsertAfter implements Node.InsertAfter .
func (*BaseNode) InsertBefore ¶
InsertBefore implements Node.InsertBefore .
func (*BaseNode) NextSibling ¶
NextSibling implements Node.NextSibling .
func (*BaseNode) OwnerDocument ¶
OwnerDocument implements Node.OwnerDocument.
func (*BaseNode) PreviousSibling ¶
PreviousSibling implements Node.PreviousSibling .
func (*BaseNode) RemoveAttributes ¶
func (n *BaseNode) RemoveAttributes()
RemoveAttributes implements Node.RemoveAttributes.
func (*BaseNode) RemoveChild ¶
RemoveChild implements Node.RemoveChild .
func (*BaseNode) RemoveChildren ¶
func (n *BaseNode) RemoveChildren()
RemoveChildren implements Node.RemoveChildren .
func (*BaseNode) ReplaceChild ¶
ReplaceChild implements Node.ReplaceChild .
func (*BaseNode) SetAttribute ¶
func (n *BaseNode) SetAttribute(name string, value textm.MultiLineValue)
SetAttribute implements Node.SetAttribute.
func (*BaseNode) SetNextSibling ¶
SetNextSibling implements Node.SetNextSibling .
func (*BaseNode) SetPreviousSibling ¶
SetPreviousSibling implements Node.SetPreviousSibling .
type BlockNode ¶
type BlockNode interface {
Node
// HasBlankPreviousLines returns true if the row before this node is blank,
// otherwise false.
HasBlankPreviousLines() bool
// SetBlankPreviousLines sets whether the row before this node is blank.
SetBlankPreviousLines(v bool)
// Source returns text segments that hold positions in a source.
// For nodes whose content is parsed into inline nodes, this holds the raw
// source text used as the input for inline parsing. Nodes that do not parse
// their content as inline elements return an empty slice.
Source() []textm.Segment
// SetSource sets text segments that hold positions in a source.
SetSource([]textm.Segment)
// AppendSource appends a text segment to the source.
AppendSource(textm.Segment)
// contains filtered or unexported methods
}
A BlockNode interface is a Node that represents a block element. Some block nodes (e.g. Paragraph, Heading) hold source text segments that are later parsed into inline nodes; others (e.g. CodeBlock, HTMLBlock) do not use this mechanism and leave Source empty.
type Blockquote ¶
type Blockquote struct {
BaseBlock
}
A Blockquote struct represents an blockquote block of Markdown text.
type CodeBlock ¶
type CodeBlock struct {
BaseBlock
// CodeBlockKind indicates whether this is an indented or fenced code block.
CodeBlockKind CodeBlockKind
// Info is the info string of a fenced code block (e.g. language identifier).
// It is empty for indented code blocks.
Info textm.SingleLineValue
// Value holds the raw content of this code block for rendering.
Value textm.Lines
}
A CodeBlock struct represents a code block of Markdown text.
func NewCodeBlock ¶
func NewCodeBlock(kind CodeBlockKind, value textm.Lines, opts ...CodeBlockOption) *CodeBlock
NewCodeBlock returns a new CodeBlock node with the given kind and value.
type CodeBlockKind ¶
type CodeBlockKind int
CodeBlockKind represents the kind of a CodeBlock: indented or fenced.
const ( // CodeBlockKindIndented indicates an indented code block (4-space or tab indent). CodeBlockKindIndented CodeBlockKind = iota + 1 // CodeBlockKindFenced indicates a fenced code block (“` or ~~~). CodeBlockKindFenced )
func (CodeBlockKind) String ¶
func (k CodeBlockKind) String() string
String returns a human-readable name of the CodeBlockKind.
type CodeBlockOption ¶
type CodeBlockOption interface {
// contains filtered or unexported methods
}
CodeBlockOption is an option for CodeBlock nodes.
func WithCodeBlockInfo ¶
func WithCodeBlockInfo(info textm.SingleLineValue) CodeBlockOption
WithCodeBlockInfo returns a CodeBlockOption that sets the info string of a fenced code block.
type CodeSpan ¶
type CodeSpan struct {
BaseInline
// Value holds the content of this code span.
// The content is sourced from the raw Markdown text and may span multiple
// source lines.
//
// This value is expected to be a single line; CommonMark requires that code span content is
// normalized to a single line by replacing newlines with spaces.
//
// Code spans that span multiple lines and return multiple indices from [text.Value].Indices()
// should return normalized single-line data from the Bytes, Str, and Value methods of [text.Value].
Value textm.Value
}
A CodeSpan struct represents a code span of Markdown text.
func NewCodeSpan ¶
NewCodeSpan returns a new CodeSpan node with the given value.
Given value is expected to be a single line; CommonMark requires that code span content is normalized to a single line by replacing newlines with spaces.
You should use CodeBlock for code that you really want to treat as multiple lines.
Code spans that span multiple lines and return multiple indices from [text.Value].Indices() should return normalized single-line data from the Bytes, Str, and Value methods of [text.Value].
type Document ¶
type Document struct {
BaseBlock
// contains filtered or unexported fields
}
A Document struct is a root node of Markdown text.
func (*Document) OwnerDocument ¶
OwnerDocument implements Node.OwnerDocument.
func (*Document) SetMetadata ¶
SetMetadata sets given metadata to this document.
type Emphasis ¶
type Emphasis struct {
BaseInline
}
An Emphasis struct represents an emphasis of Markdown text (e.g. *text* or _text_).
type HTMLBlock ¶
type HTMLBlock struct {
BaseBlock
// HTMLBlockKind is the kind of this html block.
HTMLBlockKind HTMLBlockKind
// Value holds the raw HTML content of this block for rendering.
Value textm.Lines
}
An HTMLBlock struct represents an html block of Markdown text.
func NewHTMLBlock ¶
func NewHTMLBlock(kind HTMLBlockKind) *HTMLBlock
NewHTMLBlock returns a new HTMLBlock node.
type HTMLBlockKind ¶
type HTMLBlockKind int
HTMLBlockKind represents the kind of an HTMLBlock. See https://spec.commonmark.org/0.30/#html-blocks
const ( // HTMLBlockKind1 represents type 1 html blocks. HTMLBlockKind1 HTMLBlockKind = iota + 1 // HTMLBlockKind2 represents type 2 html blocks. HTMLBlockKind2 // HTMLBlockKind3 represents type 3 html blocks. HTMLBlockKind3 // HTMLBlockKind4 represents type 4 html blocks. HTMLBlockKind4 // HTMLBlockKind5 represents type 5 html blocks. HTMLBlockKind5 // HTMLBlockKind6 represents type 6 html blocks. HTMLBlockKind6 // HTMLBlockKind7 represents type 7 html blocks. HTMLBlockKind7 )
func (HTMLBlockKind) String ¶
func (k HTMLBlockKind) String() string
String returns a human-readable name of the HTMLBlockKind.
type Heading ¶
type Heading struct {
BaseBlock
// Level is the level of this heading.
// This value is between 1 and 6.
Level int
// HeadingKind indicates whether this is an ATX or Setext heading.
HeadingKind HeadingKind
}
A Heading struct represents headings like SetextHeading and ATXHeading.
func NewHeading ¶
func NewHeading(level int, kind HeadingKind) *Heading
NewHeading returns a new Heading node.
type HeadingKind ¶
type HeadingKind int
HeadingKind represents the kind of a Heading: ATX or Setext.
const ( // HeadingKindATX represents an ATX heading (e.g. ## heading). HeadingKindATX HeadingKind = iota + 1 // HeadingKindSetext represents a Setext heading (underline style). HeadingKindSetext )
func (HeadingKind) String ¶
func (k HeadingKind) String() string
String returns a human-readable name of the HeadingKind.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
An Image struct represents an image of the Markdown text.
func NewImage ¶
func NewImage(destination textm.SingleLineValue, opts ...LinkOption) *Image
NewImage returns a new Image node with the given destination and options.
type InlineNode ¶
type InlineNode interface {
Node
// contains filtered or unexported methods
}
An InlineNode interface is a Node that represents an inline element.
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
A Link struct represents a link of the Markdown text.
func NewLink ¶
func NewLink(destination textm.SingleLineValue, opts ...LinkOption) *Link
NewLink returns a new Link node with the given destination and options.
type LinkOption ¶
type LinkOption interface {
// contains filtered or unexported methods
}
LinkOption is an option for Link and Image nodes.
func WithLinkReference ¶
func WithLinkReference(kind ReferenceLinkKind, value textm.MultiLineValue) LinkOption
WithLinkReference returns a LinkOption that sets the reference of a link or image.
type LinkReferenceDefinition ¶
type LinkReferenceDefinition struct {
BaseBlock
// Label is a label of this link reference definition.
Label textm.MultiLineValue
// Destination is a destination of this link reference definition.
Destination textm.SingleLineValue
// Title is a title of this link reference definition.
Title textm.MultiLineValue
}
A LinkReferenceDefinition struct represents a list of Markdown text.
func NewLinkReferenceDefinition ¶
func NewLinkReferenceDefinition( label textm.MultiLineValue, destination textm.SingleLineValue, opts ...LinkReferenceDefinitionOption) *LinkReferenceDefinition
NewLinkReferenceDefinition returns a new LinkReferenceDefinition node.
func (*LinkReferenceDefinition) Dump ¶
func (l *LinkReferenceDefinition) Dump(_ []byte) *NodeDump
Dump implements Node.Dump.
func (*LinkReferenceDefinition) Kind ¶
func (l *LinkReferenceDefinition) Kind() NodeKind
Kind implements Node.Kind.
type LinkReferenceDefinitionOption ¶
type LinkReferenceDefinitionOption interface {
// contains filtered or unexported methods
}
LinkReferenceDefinitionOption is an option for LinkReferenceDefinition nodes.
type List ¶
type List struct {
BaseBlock
// Marker is a marker character like '-', '+', ')' and '.'.
Marker byte
// IsTight is a true if this list is a 'tight' list.
// See https://spec.commonmark.org/0.30/#loose for details.
IsTight bool
// Start is an initial number of this ordered list.
// If this list is not an ordered list, Start is 0.
Start int
}
A List struct represents a list of Markdown text.
func (*List) CanContinue ¶
CanContinue returns true if this list can continue with the given marker character and orderedness, otherwise false.
type ListItem ¶
type ListItem struct {
BaseBlock
// contains filtered or unexported fields
}
A ListItem struct represents a list item of Markdown text.
type Node ¶
type Node interface {
// Kind returns a kind of this node.
Kind() NodeKind
// Pos returns a position of this node in a source.
// If this node position is not defined, Pos returns -1.
Pos() int
// SetPos sets a position of this node in a source.
// Some node may ignore this method. For example, Paragraph node ignores this method because
// it calculates its position from its lines.
SetPos(v int)
// NextSibling returns a next sibling node of this node.
NextSibling() Node
// PreviousSibling returns a previous sibling node of this node.
PreviousSibling() Node
// Parent returns a parent node of this node.
Parent() Node
// SetParent sets a parent node to this node.
SetParent(Node)
// SetPreviousSibling sets a previous sibling node to this node.
SetPreviousSibling(Node)
// SetNextSibling sets a next sibling node to this node.
SetNextSibling(Node)
// HasChildren returns true if this node has any children, otherwise false.
HasChildren() bool
// ChildCount returns a total number of children.
ChildCount() int
// Children returns an iterator of children of this node.
Children() iter.Seq[Node]
// FirstChild returns a first child of this node.
FirstChild() Node
// LastChild returns a last child of this node.
LastChild() Node
// AppendChild append a node child to the tail of the children.
AppendChild(child Node)
// RemoveChild removes a node child from this node.
// If a node child is not children of this node, RemoveChild nothing to do.
RemoveChild(child Node)
// RemoveChildren removes all children from this node.
RemoveChildren()
// ReplaceChild replaces a node target with a node insertee.
// If target is not a child of this node, ReplaceChild appends insertee to the
// tail of the children.
ReplaceChild(target, insertee Node)
// InsertBefore inserts a node insertee before a node target.
// If target is not a child of this node, InsertBefore appends insertee to the
// tail of the children.
InsertBefore(target, insertee Node)
// InsertAfter inserts a node insertee after a node target.
// If target is not a child of this node, InsertAfter appends insertee to the
// tail of the children.
InsertAfter(target, insertee Node)
// OwnerDocument returns this node's owner document.
// If this node is not a child of the Document node, OwnerDocument
// returns nil.
OwnerDocument() *Document
// Dump dumps an AST node.
Dump(source []byte) *NodeDump
// SetAttribute sets the given value to the attributes.
SetAttribute(name string, value textm.MultiLineValue)
// Attribute returns a (attribute value, true) if an attribute
// associated with the given name is found, otherwise
// (zero MultiLineValue, false)
Attribute(name string) (textm.MultiLineValue, bool)
// Attributes returns a list of attributes.
// This may be a nil if there are no attributes.
Attributes() []Attribute
// RemoveAttributes removes all attributes from this node.
RemoveAttributes()
}
A Node interface defines basic AST node functionalities.
func N ¶
N is a helper function to create a new node with children.
Children must be a Node or a string. If a child is a string, N creates a Text node with the string and append it to the children. Given string must be a decoded string:
- Good: `N(NewParagraph(), "Hello, World!")` - Bad: `N(NewParagraph(), "Hello, World!")`
N panics if a child is not a Node or a string.
type NodeDump ¶
type NodeDump struct {
// Node is the node to be dumped.
Node Node
// Properties is a map of additional properties to be dumped.
// Property names should be PascalCase.
Properties map[string]any
}
NodeDump is a struct that holds information for dumping a node.
func NewNodeDump ¶
NewNodeDump returns a new NodeDump.
func (*NodeDump) PrettyPrint ¶
PrettyPrint pretty prints this node dump to the given writer.
PrettyPrint format may change in the future. Do not rely on the format. This method is intended for debugging purpose only. The returned error is from the writer. If the writer never returns an error, the returned error is always nil.
type NodeKind ¶
type NodeKind int
NodeKind identifies the concrete type of a Node.
var CurrentKindValue NodeKind
CurrentKindValue is the current value of NodeKind.
You **MUST NOT** use this value. This value is public for the goldmark internal package to use.
type Paragraph ¶
type Paragraph struct {
BaseBlock
}
A Paragraph struct represents a paragraph of Markdown text.
type PrettyPrintOption ¶
type PrettyPrintOption func(*ppCfg)
PrettyPrintOption is a function that modifies the configuration of PrettyPrint.
func WithLevel ¶
func WithLevel(level int) PrettyPrintOption
WithLevel returns an option that sets the indentation level for PrettyPrint.
func WithSource ¶
func WithSource(include bool) PrettyPrintOption
WithSource returns an option that sets whether to include the source text in the PrettyPrint output.
type RawHTML ¶
type RawHTML struct {
BaseInline
// Value holds the raw HTML content.
Value textm.MultiLineValue
}
A RawHTML struct represents an inline raw HTML of the Markdown text.
func NewRawHTML ¶
func NewRawHTML(value textm.MultiLineValue) *RawHTML
NewRawHTML returns a new RawHTML node with the given value.
type ReferenceLink ¶
type ReferenceLink struct {
// ReferenceLinkKind is the kind of this reference link.
ReferenceLinkKind ReferenceLinkKind
// Value is a value of this reference link.
Value textm.MultiLineValue
}
ReferenceLink struct represents a reference link of the Markdown text.
func NewReferenceLink ¶
func NewReferenceLink(kind ReferenceLinkKind, value textm.MultiLineValue) *ReferenceLink
NewReferenceLink returns a new ReferenceLink with the given kind and value.
type ReferenceLinkKind ¶
type ReferenceLinkKind int
ReferenceLinkKind represents the kind of a reference link.
const ( // ReferenceLinkKindFull indicates that a reference link has a full reference like [foo][bar]. ReferenceLinkKindFull ReferenceLinkKind = iota + 1 // ReferenceLinkKindCollapsed indicates that a reference link has a collapsed reference like [foo][]. ReferenceLinkKindCollapsed // ReferenceLinkKindShortcut indicates that a reference link has a shortcut reference like [foo]. ReferenceLinkKindShortcut )
func (ReferenceLinkKind) String ¶
func (t ReferenceLinkKind) String() string
String returns a string representation of this reference link kind.
type Strong ¶
type Strong struct {
BaseInline
}
A Strong struct represents strong importance of Markdown text (e.g. **text** or __text__).
type Text ¶
type Text struct {
BaseInline
// Value is the text value. It is either a source position or an owned string.
Value textm.SingleLineValue
// contains filtered or unexported fields
}
A Text struct represents a textual content of the Markdown text.
func (*Text) HardLineBreak ¶
HardLineBreak returns true if this node ends with a hard line break. See https://spec.commonmark.org/0.30/#hard-line-breaks for details.
func (*Text) SetHardLineBreak ¶
SetHardLineBreak sets whether this node ends with a hard line break.
func (*Text) SetSoftLineBreak ¶
SetSoftLineBreak sets whether this node ends with a new line.
func (*Text) SoftLineBreak ¶
SoftLineBreak returns true if this node ends with a new line, otherwise false.
type ThematicBreak ¶
type ThematicBreak struct {
BaseBlock
}
A ThematicBreak struct represents a thematic break of Markdown text.
func NewThematicBreak ¶
func NewThematicBreak() *ThematicBreak
NewThematicBreak returns a new ThematicBreak node.
func (*ThematicBreak) Dump ¶
func (n *ThematicBreak) Dump(_ []byte) *NodeDump
Dump implements Node.Dump .
type WalkStatus ¶
type WalkStatus int
WalkStatus represents a current status of the Walk function.
const ( // WalkStop indicates no more walking needed. WalkStop WalkStatus = iota + 1 // WalkSkipChildren indicates that Walk will not walk on children of the current // node. WalkSkipChildren // WalkContinue indicates that Walk can continue to walk. WalkContinue )