Reputation: 7399
Im am using the gopkg.in/yaml.v2 package and I'm trying to unmarshal a yaml file like this:
Sizes:
A: small
B: small
C: medium
I created a go struct like this:
type sizesByType struct {
Map map[string]string `yaml: "Sizes"`
}
but unmarshaling it with yaml.v2 gives me an empty map.
What am I doing wrong?
Upvotes: 3
Views: 3088
Reputation: 1967
Remove the space in your struct tag:
type sizesByType struct {
Map map[string]string `yaml:"Sizes"`
}
Upvotes: 3