Add viper.IsNonDefaultSet
to check if a value is set by config, not default value
#1814
Open
1 task done
Labels
kind/enhancement
New feature or request
Preflight Checklist
Problem Description
Currently,
viper.IsSet
returnstrue
if the key has a default value. However, it would be useful to know if a value is set by the user via config/env/etc.Proposed Solution
Have a new method to check if a key is set by config/env other than the default value. It seems that viper keeps the default values of keys in
v.defaults
map:viper/viper.go
Line 1400 in d539b7a
Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: