Let's suppose I've a simple yaml like:-
info: []
return:
- foo.com:
some_value:
1.1.1.1: true
some_value2:
hey: hi
How do I get the value of foo.com as a string? I really don't care what structure is inside.
Using the popular library, gopkg.in/yaml.v2, I've tried a struct like this:-
type ExecuteJidResp struct {
Info []interface{} `yaml:"info"`
Return []map[string]interface{} `yaml:"return,omitempty"`
}
But, it errors out with:-
panic: yaml: line 4: found character that cannot start any token
Full code: https://play.golang.org/p/RJtQ9V9qGEY