View definition

func SetTypeByDefaultValue

Defined in


SetTypeByDefaultValue enables or disables the inference of a key value's type when the Get function is used based upon a key's default value as opposed to the value returned based on the normal fetch logic.

For example, if a key has a default value of []string{} and the same key is set via an environment variable to "a b c", a call to the Get function would return a string slice for the key if the key's type is inferred by the default value and the Get function would return:

[]string {"a", "b", "c"}

Otherwise the Get function would return:

"a b c"

SetTypeByDefaultValue is referenced in 0 repositories