gurkankaymak / hocon

go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config
MIT License
79 stars 17 forks source link

Error when comment with # at the end of an array declare #46

Closed donglinjy closed 11 months ago

donglinjy commented 11 months ago

It will fail to load string configure as below, with error error while parsing configuration: missing comma! at: 4:11, values should have comma or ASCII newline ('\n') between them.

It will work well if I change to use // comment 2.

    hoconString = `
            key1 {
              arr = [ 1, 2, # this is comment 1
              3, 4 # this is comment 2
              ]
            }`

    _, err = hocon.ParseString(hoconString)
    if err != nil {
        log.Println("error while parsing configuration: ", err)
    }