-
-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Description
Consider the following example:
config.go:
type MyConfig struct {
FooBar `yaml:"foo_bar,omitempty" default:"baz"`
}config.yaml:
foo_bar: With configor 1.2.1, the above config led to FooBar being set to an empty string, while with configor 1.2.2, FooBar will be set to the default value of "baz".
First of all, I think that this should have gotten mentioned somewhere, because it's kind of a breaking change in some cases.
Besides that, I think the new behavior is a bit counterintuitive. For my taste, you should be able to overwrite a property - even if it has a default value - by explicitly setting it in YAML. So for me it would make sense to (a) take default value if key is not specified in YAML, but (b) take whatever value from the YAML if key is specified there, even if blank.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels