-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add viper.SetKeysCaseSensitive() to disable automatic key lowercasing.
YAML, TOML, and JSON dictate keys to be case-sensitive. Viper's default behaviour of lowercasing the keys for key insensitivity is incompatible with these standards and has the side effect of making it difficult for use cases such as case sensitive API credentials in configuration. For eg: MyApiKey=MySecret (in TOML). See #131, #260, #293, #371, #373 This commit adds a global function `viper.SetKeysCaseSensitive()` that enables this behaviour to be turned off, after which, all keys, irrespective of nesting, retain their cases. This respects all configuration operations including getting, setting, and merging.
- Loading branch information
Showing
3 changed files
with
158 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.