gurkankaymak / hocon

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

`hocon.ParseString(config.String())` will be error #16

Closed Rory-Z closed 2 years ago

Rory-Z commented 2 years ago

Hello, this is a great project and it has been very helpful to me, thx.

But I have a issue

When I set config like this:

str := `listener.bind = "0.0.0.0:1883"`
config, err := hocon.ParseString(str)
assert.Nil(t, err)
assert.Equal(t, "1883", config.GetString("listener.bind"))

Looks good, but when I running hocon.ParseString(config.String()) I got error

&hocon.ParseError{errType:"missing comma!", message:"values should have comma or ASCII newline ('\\n') between them", line:1, column:20}

The config.String() will output {listener:{bind:0.0.0.0:1883}}, that's why will be error, I think it should output {listener:{bind:"0.0.0.0:1883"}}

Is there anything can help me ?