Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested lists #17

Open
PlkMarudny opened this issue Dec 26, 2017 · 1 comment
Open

Nested lists #17

PlkMarudny opened this issue Dec 26, 2017 · 1 comment

Comments

@PlkMarudny
Copy link

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.

@orymate
Copy link
Contributor

orymate commented Sep 10, 2018

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants