Documentation
¶
Overview ¶
Package yamlalias adds support for aliases when parsing YAML.
Aliases are specified as a comma-separated list specified via "yaml-aliases" struct tag.
Example:
type Config struct { UserName string `yaml:"username" yaml-aliases:"userName,user-name"` }
This will parse the following YAML examples in the same way:
{"username": "John Doe"} {"userName": "John Doe"} {"user-name": "John Doe"}
Note: It only adds aliases for top-level fields in the struct.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
Unmarshal is a wrapper for yaml.Unmarshal but adds support for any yaml-aliases specified in out.
func UnmarshalStrict ¶
UnmarshalStrict is a wrapper for yaml.UnmarshalStrict but adds support for any yaml-aliases specified in out.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.