You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hallo,
I know this has been mentioned plenty of times (#462, #165 (comment) and so on) and that you can implement UnmarshalYAML to set your own defaults.
Buuuuuut if you have multiple types of configs, and in each of them just a single field needs a default, implementing UnmarshalYAML in each of them makes your code quite bloated. It really seems complexity that could be hidden in the library itself.
Is something like
type Config struct {
A string `string_name, omitempty, default="abc"`
B int `int_name, omitempty, default=10`
C bool `bool_name, omitempty, default=true`
}
in the roadmap? Or is there some deeper reason (I mean in the code) for this missing feature so it will never be implemented?
The text was updated successfully, but these errors were encountered:
Hallo,
I know this has been mentioned plenty of times (#462, #165 (comment) and so on) and that you can implement
UnmarshalYAML
to set your own defaults.Buuuuuut if you have multiple types of configs, and in each of them just a single field needs a default, implementing
UnmarshalYAML
in each of them makes your code quite bloated. It really seems complexity that could be hidden in the library itself.Is something like
in the roadmap? Or is there some deeper reason (I mean in the code) for this missing feature so it will never be implemented?
The text was updated successfully, but these errors were encountered: