magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Unable to parse an array of values #56

Open ahshah opened 3 years ago

ahshah commented 3 years ago

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 commented 1 year ago

use semi-colon