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

Unable to parse an array of values #56

Open
ahshah opened this issue Apr 21, 2021 · 1 comment
Open

Unable to parse an array of values #56

ahshah opened this issue Apr 21, 2021 · 1 comment

Comments

@ahshah
Copy link

ahshah commented Apr 21, 2021

Given a properties file consisting of:

Test = foo,bar,baz

A config struct of

type Config struct {
    Test []string `properties:"Test"`
}

And the following decoding

    var cfg Config
    if err := p.Decode(&cfg); err != nil {
        log.Fatal(err)
    }
    fmt.Printf("got test values: %s\n", cfg.Test[1])
```

My program crashes as cfg.Test is of length 1.
@yslim
Copy link

yslim commented May 7, 2023

use semi-colon

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