goyamlparser

package
v0.0.0-...-7344eb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: MIT, Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	NULL_TAG      = "tag:yaml.org,2002:null"      // The tag !!null with the only possible value: null.
	BOOL_TAG      = "tag:yaml.org,2002:bool"      // The tag !!bool with the values: true and false.
	STR_TAG       = "tag:yaml.org,2002:str"       // The tag !!str for string values.
	INT_TAG       = "tag:yaml.org,2002:int"       // The tag !!int for integer values.
	FLOAT_TAG     = "tag:yaml.org,2002:float"     // The tag !!float for float values.
	TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values.

	SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences.
	MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping.

	// Not in original libyaml.
	BINARY_TAG = "tag:yaml.org,2002:binary"
	MERGE_TAG  = "tag:yaml.org,2002:merge"

	DEFAULT_SCALAR_TAG   = STR_TAG // The default scalar tag is !!str.
	DEFAULT_SEQUENCE_TAG = SEQ_TAG // The default sequence tag is !!seq.
	DEFAULT_MAPPING_TAG  = MAP_TAG // The default mapping tag is !!map.
)

Nodes

Variables

This section is empty.

Functions

func DefaultDepthCheck

func DefaultDepthCheck(depth int, ctx *DepthContext) error

func ParseYAMLScriptEvents

func ParseYAMLScriptEvents(input string) (any, error)

func ParserGetEvents

func ParserGetEvents(in []byte) (string, error)

ParserGetEvents parses the YAML input and returns the generated event stream.

func StartCompileProgress

func StartCompileProgress(pending, success, failure string) func(bool)

StartCompileProgress returns a completion callback that stops its ticker.

func WriteNewTextFile

func WriteNewTextFile(path, text string, mode int64) error

WriteNewTextFile writes compiled source without replacing an existing path.

func WriteTextFile

func WriteTextFile(path, text string, mode int64) error

Types

type AliasData

type AliasData struct {
	// contains filtered or unexported fields
}

AliasData holds information about aliases.

type Comment

type Comment struct {
	ScanMark  Mark // Position where scanning for comments started
	TokenMark Mark // Position after which tokens will be associated with this comment
	StartMark Mark // Position of '#' comment mark
	EndMark   Mark // Position where comment terminated

	Head []byte
	Line []byte
	Foot []byte
}

Comment holds information about a comment in the YAML stream.

type Composer

type Composer struct {
	Parser Parser
}

func NewComposer

func NewComposer(in []byte, options any) *Composer

func (*Composer) Destroy

func (c *Composer) Destroy()

type DepthContext

type DepthContext struct {
	Kind DepthKind
}

type DepthKind

type DepthKind string
const (
	DepthKindFlow  DepthKind = "flow"
	DepthKindBlock DepthKind = "block"
)

type DumpError

type DumpError struct {
	Stage   Stage  // Processing stage where error occurred
	Message string // Error description
	// contains filtered or unexported fields
}

DumpError represents an error that occurred while dumping a YAML document.

It identifies the processing stage where the error occurred and provides an optional underlying cause via Unwrap.

func NewDumpError

func NewDumpError(stage Stage, message string, cause error) *DumpError

NewDumpError creates a DumpError with an underlying cause. The cause is accessible via Unwrap for use with errors.Is and errors.As.

func (*DumpError) Error

func (e *DumpError) Error() string

Error returns the error message with stage information. Format: "go-yaml dump error in <stage>: <message>"

func (*DumpError) Unwrap

func (e *DumpError) Unwrap() error

Unwrap returns the underlying error.

type EmitterError

type EmitterError struct {
	Message string
}

EmitterError represents an error that occurred during emitting.

func (EmitterError) Error

func (e EmitterError) Error() string

Error returns the error message.

type Encoding

type Encoding int

Encoding represents the character encoding of a YAML stream.

const (
	// Let the parser choose the encoding.
	ANY_ENCODING Encoding = iota

	UTF8_ENCODING    // The default UTF-8 encoding.
	UTF16LE_ENCODING // The UTF-16-LE encoding with BOM.
	UTF16BE_ENCODING // The UTF-16-BE encoding with BOM.
)

The stream encoding.

type ErrorType

type ErrorType int

ErrorType represents the category of error that occurred during processing.

const (
	// No error is produced.
	NO_ERROR ErrorType = iota

	MEMORY_ERROR   // Cannot allocate or reallocate a block of memory.
	READER_ERROR   // Cannot read or decode the input stream.
	SCANNER_ERROR  // Cannot scan the input stream.
	PARSER_ERROR   // Cannot parse the input stream.
	COMPOSER_ERROR // Cannot compose a YAML document.
	WRITER_ERROR   // Cannot write to the output stream.
	EMITTER_ERROR  // Cannot emit a YAML stream.
)

Many bad things could happen with the parser and emitter.

type Event

type Event struct {
	// The event type.
	Type EventType

	// The start and end of the event.
	StartMark, EndMark Mark

	// The comments
	HeadComment []byte
	LineComment []byte
	FootComment []byte
	TailComment []byte

	// The Anchor (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT, ALIAS_EVENT).
	Anchor []byte

	// The Tag (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT).
	Tag []byte

	// The scalar Value (for SCALAR_EVENT).
	Value []byte

	// Is the document start/end indicator Implicit, or the tag optional?
	// (for DOCUMENT_START_EVENT, DOCUMENT_END_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT, SCALAR_EVENT).
	Implicit bool

	// The Style (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT).
	Style Style
	// contains filtered or unexported fields
}

Event holds information about a parsing or emitting event.

func (*Event) Delete

func (e *Event) Delete()

func (*Event) GetEncoding

func (e *Event) GetEncoding() Encoding

GetEncoding returns the stream encoding (for STREAM_START_EVENT).

func (*Event) GetQuotedImplicit

func (e *Event) GetQuotedImplicit() bool

GetQuotedImplicit reports whether a scalar tag may be omitted for a non-plain scalar style.

func (*Event) GetTagDirectives

func (e *Event) GetTagDirectives() []TagDirective

GetTagDirectives returns the tag directives (for DOCUMENT_START_EVENT).

func (*Event) GetVersionDirective

func (e *Event) GetVersionDirective() *VersionDirective

GetVersionDirective returns the version directive (for DOCUMENT_START_EVENT).

func (*Event) MappingStyle

func (e *Event) MappingStyle() MappingStyle

MappingStyle returns the style of a mapping event.

func (*Event) ScalarStyle

func (e *Event) ScalarStyle() ScalarStyle

ScalarStyle returns the style of a scalar event.

func (*Event) SequenceStyle

func (e *Event) SequenceStyle() SequenceStyle

SequenceStyle returns the style of a sequence event.

type EventType

type EventType int8

EventType represents the type of a parsing or emitting event.

const (
	// An empty event.
	NO_EVENT EventType = iota

	STREAM_START_EVENT   // A STREAM-START event.
	STREAM_END_EVENT     // A STREAM-END event.
	DOCUMENT_START_EVENT // A DOCUMENT-START event.
	DOCUMENT_END_EVENT   // A DOCUMENT-END event.
	ALIAS_EVENT          // An ALIAS event.
	SCALAR_EVENT         // A SCALAR event.
	SEQUENCE_START_EVENT // A SEQUENCE-START event.
	SEQUENCE_END_EVENT   // A SEQUENCE-END event.
	MAPPING_START_EVENT  // A MAPPING-START event.
	MAPPING_END_EVENT    // A MAPPING-END event.
	TAIL_COMMENT_EVENT
)

Event types.

func (EventType) String

func (e EventType) String() string

String returns a string representation of the event type.

type IndentConfig

type IndentConfig struct {
	Mode      IndentMode
	LoadStyle IndentStyle
	DumpStyle IndentStyle
	Scope     IndentScope
}

type IndentMode

type IndentMode string
const (
	IndentModeAuto IndentMode = "auto"
	IndentModeTabs IndentMode = "tabs"
)

type IndentScope

type IndentScope string
const (
	IndentScopeDocument IndentScope = "document"
	IndentScopeStream   IndentScope = "stream"
)

type IndentStyle

type IndentStyle string
const (
	IndentStyleAuto   IndentStyle = "auto"
	IndentStyleSpaces IndentStyle = "spaces"
	IndentStyleTabs   IndentStyle = "tabs"
)

type LineBreak

type LineBreak int

LineBreak represents the line break style used in YAML output.

const (
	// Let the parser choose the break type.
	ANY_BREAK LineBreak = iota

	CR_BREAK   // Use CR for line breaks (Mac style).
	LN_BREAK   // Use LN for line breaks (Unix style).
	CRLN_BREAK // Use CR LN for line breaks (DOS style).
)

Line break types.

type LoadError

type LoadError struct {
	Stage   Stage  // Processing stage where error occurred
	Message string // Error description

	// Position information
	Mark        Mark   // Primary error position
	ContextMark Mark   // Optional context position (e.g., start of construct)
	ContextMsg  string // Optional context message
	// contains filtered or unexported fields
}

LoadError represents an error that occurred while loading a YAML document.

It provides detailed location information and identifies the processing stage where the error occurred.

func NewLoadError

func NewLoadError(stage Stage, message string, mark Mark, cause error) *LoadError

NewLoadError creates a LoadError with an underlying cause. The cause is accessible via Unwrap for use with errors.Is and errors.As.

func (*LoadError) Error

func (e *LoadError) Error() string

Error returns the error message with stage and position information. Format: "go-yaml load error in <stage> at L:C: <message>" Or with context: "go-yaml load error in <stage> (<ctx>) at L:C-L:C: <message>"

func (*LoadError) Unwrap

func (e *LoadError) Unwrap() error

Unwrap returns the underlying error.

type LoadErrors

type LoadErrors struct {
	Errors []*LoadError
}

LoadErrors is returned when one or more fields cannot be properly decoded.

func (*LoadErrors) As

func (e *LoadErrors) As(target any) bool

As implements errors.As for Go versions prior to 1.20 that don't support the Unwrap() []error interface. It allows LoadErrors to match against *LoadError or *TypeError targets.

func (*LoadErrors) Error

func (e *LoadErrors) Error() string

Error returns a formatted error message listing all construct errors.

func (*LoadErrors) Is

func (e *LoadErrors) Is(target error) bool

Is implements errors.Is for Go versions prior to 1.20 that don't support the Unwrap() []error interface. It checks if any wrapped error matches the target error.

type MappingStyle

type MappingStyle styleInt

MappingStyle represents the formatting style of a mapping node.

const (
	// Let the emitter choose the style.
	ANY_MAPPING_STYLE MappingStyle = iota

	BLOCK_MAPPING_STYLE // The block mapping style.
	FLOW_MAPPING_STYLE  // The flow mapping style.
)

Mapping styles.

type Mark

type Mark struct {
	Index  int // The position index.
	Line   int // The position line (1-indexed; 0 means unknown).
	Column int // The position column (1-indexed; 0 means unknown).
}

Mark holds the pointer position.

func (Mark) String

func (m Mark) String() string

String returns a human-readable string representation of the position mark.

type Parser

type Parser struct {
	HeadComment []byte // The current head comments
	LineComment []byte // The current line comments
	FootComment []byte // The current foot comments
	// contains filtered or unexported fields
}

Parser structure holds all information about the current state of the parser.

func NewParser

func NewParser() Parser

NewParser creates a new parser object.

func (*Parser) Delete

func (parser *Parser) Delete()

Delete a parser object.

func (*Parser) GetCommentsHead

func (parser *Parser) GetCommentsHead() int

GetCommentsHead returns the current position in the comment queue.

func (*Parser) GetPendingComments

func (parser *Parser) GetPendingComments() []Comment

GetPendingComments returns the parser's comment queue for CLI access.

func (*Parser) Parse

func (parser *Parser) Parse(event *Event) error

Parse gets the next event.

func (*Parser) Scan

func (parser *Parser) Scan(token *Token) error

Scan advances the buffer pointer and reads the next token.

func (*Parser) SetEncoding

func (parser *Parser) SetEncoding(encoding Encoding)

SetEncoding sets the source encoding.

func (*Parser) SetIndentConfig

func (parser *Parser) SetIndentConfig(config *IndentConfig)

SetIndentConfig configures tab-aware indentation scanning.

func (*Parser) SetInputEvents

func (parser *Parser) SetInputEvents(events []Event)

SetInputEvents sets a pre-parsed event stream. It is intended for internal pipeline tooling that needs to resume processing at the composer stage.

func (*Parser) SetInputReader

func (parser *Parser) SetInputReader(r io.Reader)

SetInputReader sets a file input.

func (*Parser) SetInputString

func (parser *Parser) SetInputString(input []byte)

SetInputString sets a string input.

func (*Parser) SetInputTokens

func (parser *Parser) SetInputTokens(tokens []Token, comments []Comment)

SetInputTokens sets a pre-tokenized input stream. It is intended for internal pipeline tooling that needs to resume processing at the parser stage.

func (*Parser) SetSkipComments

func (parser *Parser) SetSkipComments(skip bool)

SetSkipComments enables or disables comment scanning. When enabled, the scanner skips comment tokens for better performance.

func (*Parser) UnfoldComments

func (parser *Parser) UnfoldComments(token *Token)

UnfoldComments walks through the comments queue and joins all comments behind the position of the provided token into the respective top-level comment slices in the parser.

type ParserState

type ParserState int

ParserState represents the state of the parser.

const (
	PARSE_STREAM_START_STATE ParserState = iota

	PARSE_IMPLICIT_DOCUMENT_START_STATE           // Expect the beginning of an implicit document.
	PARSE_DOCUMENT_START_STATE                    // Expect DOCUMENT-START.
	PARSE_DOCUMENT_CONTENT_STATE                  // Expect the content of a document.
	PARSE_DOCUMENT_END_STATE                      // Expect DOCUMENT-END.
	PARSE_BLOCK_NODE_STATE                        // Expect a block node.
	PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE        // Expect the first entry of a block sequence.
	PARSE_BLOCK_SEQUENCE_ENTRY_STATE              // Expect an entry of a block sequence.
	PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE         // Expect an entry of an indentless sequence.
	PARSE_BLOCK_MAPPING_FIRST_KEY_STATE           // Expect the first key of a block mapping.
	PARSE_BLOCK_MAPPING_KEY_STATE                 // Expect a block mapping key.
	PARSE_BLOCK_MAPPING_VALUE_STATE               // Expect a block mapping value.
	PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE         // Expect the first entry of a flow sequence.
	PARSE_FLOW_SEQUENCE_ENTRY_STATE               // Expect an entry of a flow sequence.
	PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE   // Expect a key of an ordered mapping.
	PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping.
	PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE   // Expect the and of an ordered mapping entry.
	PARSE_FLOW_MAPPING_FIRST_KEY_STATE            // Expect the first key of a flow mapping.
	PARSE_FLOW_MAPPING_KEY_STATE                  // Expect a key of a flow mapping.
	PARSE_FLOW_MAPPING_VALUE_STATE                // Expect a value of a flow mapping.
	PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE          // Expect an empty value of a flow mapping.
	PARSE_END_STATE                               // Expect nothing.
)

Parser state constants define the different states the parser can be in.

func (ParserState) String

func (ps ParserState) String() string

String returns a string representation of the parser state.

type QuoteStyle

type QuoteStyle int

QuoteStyle represents the preferred quote style for scalar values.

const (
	QuoteSingle QuoteStyle = iota // Prefer single quotes when quoting is required.
	QuoteDouble                   // Prefer double quotes when quoting is required.
	QuoteLegacy                   // Legacy behavior: double in representer, single in emitter.
)

Quote style types for required quoting.

func (QuoteStyle) ScalarStyle

func (q QuoteStyle) ScalarStyle() ScalarStyle

ScalarStyle returns the scalar style for this quote preference in the representer/serializer context. In this context, both QuoteDouble and QuoteLegacy use double quotes.

type ReadHandler

type ReadHandler func(parser *Parser, buffer []byte) (n int, err error)

ReadHandler is called by the Parser when it needs to read more bytes from the input source. The handler should fill the provided buffer with up to len(buffer) bytes from the input source.

The arguments are as follows:

[in] parser The parser object. [out] buffer The buffer for reading. [out] size_read The actual number of bytes read from the source.

On success, the handler should return 1. If the handler failed, the returned value should be 0. On EOF, the handler should set the size_read to 0 and return 1.

type ScalarStyle

type ScalarStyle styleInt

ScalarStyle represents the formatting style of a scalar value.

const (
	// Let the emitter choose the style.
	ANY_SCALAR_STYLE ScalarStyle = 0

	PLAIN_SCALAR_STYLE         ScalarStyle = 1 << iota // The plain scalar style.
	SINGLE_QUOTED_SCALAR_STYLE                         // The single-quoted scalar style.
	DOUBLE_QUOTED_SCALAR_STYLE                         // The double-quoted scalar style.
	LITERAL_SCALAR_STYLE                               // The literal scalar style.
	FOLDED_SCALAR_STYLE                                // The folded scalar style.
)

Scalar styles.

func (ScalarStyle) String

func (style ScalarStyle) String() string

String returns a string representation of a ScalarStyle.

type SequenceStyle

type SequenceStyle styleInt

SequenceStyle represents the formatting style of a sequence node.

const (
	// Let the emitter choose the style.
	ANY_SEQUENCE_STYLE SequenceStyle = iota

	BLOCK_SEQUENCE_STYLE // The block sequence style.
	FLOW_SEQUENCE_STYLE  // The flow sequence style.
)

Sequence styles.

type SimpleKey

type SimpleKey struct {
	// contains filtered or unexported fields
}

SimpleKey holds information about a potential simple key.

type Stage

type Stage string

Stage identifies the processing stage where an error occurred during YAML loading or dumping.

const (
	// Load stages
	ReaderStage      Stage = "reader"      // Input reading and encoding
	ScannerStage     Stage = "scanner"     // Tokenization
	ParserStage      Stage = "parser"      // Event stream parsing
	ComposerStage    Stage = "composer"    // Node tree construction
	ResolverStage    Stage = "resolver"    // Tag resolution
	ConstructorStage Stage = "constructor" // Go value construction

	// Dump stages
	RepresenterStage Stage = "representer" // Go value to Node tree
	SerializerStage  Stage = "serializer"  // Node tree to events
	EmitterStage     Stage = "emitter"     // Events to YAML bytes
	WriterStage      Stage = "writer"      // Output writing
)

type Style

type Style uint32

type TagDirective

type TagDirective struct {
	// contains filtered or unexported fields
}

TagDirective holds the YAML tag directive data.

func NewTagDirective

func NewTagDirective(handle, prefix string) TagDirective

NewTagDirective creates YAML tag directive data.

func (*TagDirective) GetHandle

func (t *TagDirective) GetHandle() string

GetHandle returns the tag handle.

func (*TagDirective) GetPrefix

func (t *TagDirective) GetPrefix() string

GetPrefix returns the tag prefix.

type Token

type Token struct {
	// The token type.
	Type TokenType

	// The start/end of the token.
	StartMark, EndMark Mark

	// The alias/anchor/scalar Value or tag/tag directive handle
	// (for ALIAS_TOKEN, ANCHOR_TOKEN, SCALAR_TOKEN, TAG_TOKEN, TAG_DIRECTIVE_TOKEN).
	Value []byte

	// The scalar Style (for SCALAR_TOKEN).
	Style ScalarStyle
	// contains filtered or unexported fields
}

Token holds information about a scanning token.

func (*Token) GetEncoding

func (t *Token) GetEncoding() Encoding

GetEncoding returns the stream encoding carried by a STREAM-START token.

func (*Token) GetPrefix

func (t *Token) GetPrefix() string

GetPrefix returns the prefix carried by a TAG-DIRECTIVE token.

func (*Token) GetSuffix

func (t *Token) GetSuffix() string

GetSuffix returns the suffix carried by a TAG token.

func (*Token) GetVersion

func (t *Token) GetVersion() (int, int)

GetVersion returns the version carried by a VERSION-DIRECTIVE token.

func (*Token) SetEncoding

func (t *Token) SetEncoding(encoding Encoding)

SetEncoding sets the stream encoding carried by a STREAM-START token.

func (*Token) SetPrefix

func (t *Token) SetPrefix(prefix string)

SetPrefix sets the prefix carried by a TAG-DIRECTIVE token.

func (*Token) SetSuffix

func (t *Token) SetSuffix(suffix string)

SetSuffix sets the suffix carried by a TAG token.

func (*Token) SetVersion

func (t *Token) SetVersion(major, minor int)

SetVersion sets the version carried by a VERSION-DIRECTIVE token.

type TokenType

type TokenType int

TokenType represents the type of a scanned token.

const (
	// An empty token.
	NO_TOKEN TokenType = iota

	STREAM_START_TOKEN // A STREAM-START token.
	STREAM_END_TOKEN   // A STREAM-END token.

	VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token.
	TAG_DIRECTIVE_TOKEN     // A TAG-DIRECTIVE token.
	DOCUMENT_START_TOKEN    // A DOCUMENT-START token.
	DOCUMENT_END_TOKEN      // A DOCUMENT-END token.

	BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token.
	BLOCK_MAPPING_START_TOKEN  // A BLOCK-SEQUENCE-END token.
	BLOCK_END_TOKEN            // A BLOCK-END token.

	FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token.
	FLOW_SEQUENCE_END_TOKEN   // A FLOW-SEQUENCE-END token.
	FLOW_MAPPING_START_TOKEN  // A FLOW-MAPPING-START token.
	FLOW_MAPPING_END_TOKEN    // A FLOW-MAPPING-END token.

	BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token.
	FLOW_ENTRY_TOKEN  // A FLOW-ENTRY token.
	KEY_TOKEN         // A KEY token.
	VALUE_TOKEN       // A VALUE token.

	ALIAS_TOKEN   // An ALIAS token.
	ANCHOR_TOKEN  // An ANCHOR token.
	TAG_TOKEN     // A TAG token.
	SCALAR_TOKEN  // A SCALAR token.
	COMMENT_TOKEN // A COMMENT token.
)

Token types.

func (TokenType) String

func (tt TokenType) String() string

String returns a string representation of the token type.

type TypeError deprecated

type TypeError struct {
	Errors []string
}

TypeError is a legacy error type retained for compatibility.

A TypeError is returned by Unmarshal when one or more fields in the YAML document cannot be properly decoded into the requested types. When this error is returned, the value is still unmarshaled partially.

Deprecated: Use LoadErrors instead.

func (*TypeError) Error

func (e *TypeError) Error() string

Error returns a formatted error message listing all unmarshal errors.

type VersionDirective

type VersionDirective struct {
	// contains filtered or unexported fields
}

VersionDirective holds the YAML version directive data.

func NewVersionDirective

func NewVersionDirective(major, minor int) *VersionDirective

NewVersionDirective creates YAML version directive data.

func (*VersionDirective) Major

func (v *VersionDirective) Major() int

Major returns the major version number.

func (*VersionDirective) Minor

func (v *VersionDirective) Minor() int

Minor returns the minor version number.

type WriterError

type WriterError struct {
	Err error
}

WriterError represents an error that occurred while writing output.

func (WriterError) Error

func (e WriterError) Error() string

Error returns the error message.

func (WriterError) Unwrap

func (e WriterError) Unwrap() error

Unwrap returns the underlying error.

type YAMLError

type YAMLError struct {
	Err error
}

YAMLError is an internal error wrapper type.

func (*YAMLError) Error

func (e *YAMLError) Error() string

Error returns the error message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL