config
config copied to clipboard
Nested lists
Hi,
What about such a YAML config:
part1:
- level1:
- level2:
-level3:
key1: value1
key2: value2
How to get deeper nested lists?
cfg.List("part1.0.0.)
does not seem to work.
Not an issue, nested lists do work correctly. Given that the missing spaces are added, you have nested lists of single-key maps: {"part1":[{"level1":[{"level2":[{"level3":{"key1":"value1","key2":"value2"}}]}]}]}.
cfg, err := config.ParseYaml("bar: [[[foo]]]")
fmt.Println(err, cfg.UList("bar.0.0"))
gives <nil> [foo]