-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
I caught a problem with slice values that have commas in them. The line is divided by commas, and instead of one value in a slice, you get several values. This happens with both JSON and TOML.
type Config struct {
Section struct {
ID []string
}
}
{"section": {"id": ["a","b", "c,d"]}}
[section]
id = ["a", "b", "c,d"]
Result slice of Config.Section.ID
will have 4 values: "a", "b", "c" and "d".
The problem is related to the way values in slices are filled. *Loader.setSlice
accepts a string formed with a comma separator. I suggest using a more complex separator so that the chance of encountering it in a row is lower. For example: ",;:|
".
Metadata
Metadata
Assignees
Labels
No labels