Documentation
¶
Overview ¶
Package yaml provides an API for YAML serialization that can automatically infers types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( True = []byte("true") False = []byte("false") Null = []byte("null") BoundaryMarker = []byte("---\n") )
View Source
var ( ErrEmptyInput = errors.New("empty input") ErrInvalidRune = errors.New("invalid rune") )
Functions ¶
func Unmarshal ¶
Unmarshal parses a slice of bytes into an object using a few simple type inference rules. This package is useful when your program needs to parse data, that you have no a priori awareness of its structure or type. If no input is given, then returns ErrEmptyInput. If the first rune is invalid, then returns ErrInvalidRune.
- true => true (bool)
- false => false (bool)
- null => nil
- [...] => []interface{}
- -... => []interface{}
- {...} => map[string]interface{}
- "..." => string
- otherwise trys to parse as float
Types ¶
type ErrInvalidKind ¶
func (ErrInvalidKind) Error ¶
func (e ErrInvalidKind) Error() string
Click to show internal directories.
Click to hide internal directories.