Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
mark-summerfield opened this issue Dec 3, 2023 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@mark-summerfield
Copy link

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
@mark-summerfield mark-summerfield added the bug Something isn't working label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant