You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will fail to load string configure as below, with error error while parsing configuration: missing comma! at: 4:13, values should have comma or ASCII newline ('\n') between them.
The root cause may be because text scanner will parse 2.2.0 into 2.2 and .0, and will parse c-f1.2g into c-f1, .2, and g.
hoconString := `
key1 {
a = "a"
b = 2.2.0
c-f1.2g = "ok"
}`
_, err := hocon.ParseString(hoconString)
if err != nil {
log.Println("error while parsing configuration: ", err)
}
The text was updated successfully, but these errors were encountered:
Hi @donglinjy, thanks for reporting the issue.
Yeah, the root of the issue is that the Golang text scanner parses as you described ('2.2.0' into '2.2' and '.0'). I'll look for a solution. In the meantime, you can use double quotes
Hi @donglinjy, thanks for reporting the issue. Yeah, the root of the issue is that the Golang text scanner parses as you described ('2.2.0' into '2.2' and '.0'). I'll look for a solution. In the meantime, you can use double quotes
key1 {
a = "a"
b = "2.2.0"
"c-f1.2g" = "ok"
}
Thanks. Based on what I tried, to work around it, for the issue in value like 2.2.0, we can double quote it. But for key like c-f1.2g, will need to quote each parts split by . as blow, or the config loading will succeed, but it won't allow you to read config like GetString("key1.c-f1.2g").
I will fail to load string configure as below, with error
error while parsing configuration: missing comma! at: 4:13, values should have comma or ASCII newline ('\n') between them
.The root cause may be because text scanner will parse
2.2.0
into2.2
and.0
, and will parsec-f1.2g
intoc-f1
,.2
, andg
.The text was updated successfully, but these errors were encountered: