Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FStringer ¶
type FStringer interface { // FString traverses the format string. // // Parameters: // - trav: The traverser to use. Assumed to be non-nil. // // Returns: // - error: An error if the format string could not be traversed. FString(trav Traverser) error }
FStringer is the interface for a format string traverser.
type Traverser ¶
type Traverser interface { // WriteLine writes a line to the traverser. // // Parameters: // - str: The line to write. // // Returns: // - error: An error if the line could not be written. WriteLine(str string) error io.Writer }
Traverser is the interface for a format string traverser.
type Traversor ¶
type Traversor struct {
// contains filtered or unexported fields
}
Traversor is the traverser.
func New ¶
New creates a new traverser.
Parameters:
- w: The writer to write to.
Returns:
- *Traversor: The new traverser. Never returns nil.
If w is nil, it is set to io.Discard.
func (*Traversor) IndentBy ¶
IndentBy increments the indent level by n.
Parameters:
- n: The amount to increment the indent level by.
Returns:
- *Traversor: The traverser.
- error: An error if the traverser could not be created.
If the new indent level is less than 0, it is set to 0.
Click to show internal directories.
Click to hide internal directories.