-
Notifications
You must be signed in to change notification settings - Fork 370
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
Case insensitive ini keys #36
Comments
Hi, can you give an example use of this feature? |
Sure. Sometimes keys are written by users in mixed case format, even if you specify in the docs that have to be lowercase. So that, you can have in ini file: FOO = bar Would be able to retrieve the same value using case insensitive key retrieval. |
Thanks, so there is one problem left, inside the library, all key names will be stored as in lower cases. Therefore if you want to write out them, output format will have all lowercase key names. Does this sound OK to you? |
Apologies for the long-waiting answer. |
Example: cfg, err := ini.InsensitiveLoad("filename")
//...
// sec1 and sec2 are the exactly same section object
sec1, err := cfg.GetSection("Section")
sec2, err := cfg.GetSection("SecTIOn")
// key1 and key2 are the exactly same key object
key1, err := cfg.GetKey("Key")
key2, err := cfg.GetKey("KeY") |
Please support case insensitive keys and sections in an ini file, ex: via an option.
ex: treat "FOO = bar" like "foo = bar" or "Foo = bar".
Thanks
The text was updated successfully, but these errors were encountered: