go-ini/ini

using []string in a struct goes wrong if any of the strings contains a comma ','

mark-summerfield opened this issue · 0 comments

Version

go version go1.21.4 linux/amd64

Describe the bug

I have a struct:

type Config struct {
	Scale    float32
	History  []string
}

This normally works fine with ini.ReflectFrom and ini.Load. However if one of the strings has a comma ',' it doesn't work correctly.

To reproduce

Try a .ini file like this:

Scale = 1.5
History = Test One,Test Two,Test with comma, Three,Test Four

Expected behavior

I expect it to quote commas on save and unquote them on load.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct