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
If needed some more explanation, code or screens, fell free to write.
If there is any other method to load data like from files but from source maps or maybe there is possibility to create something like Merge(any...)
The text was updated successfully, but these errors were encountered:
I don't think this is a bug. The equivalent of LoadData here should be loading map[string]any, without pointer. Becasue when you create struct, zero values are assigned automatically.
When LoadFile, contents are converted to map[string]any instead of a predefined struct.
LoadData uses mergo.Merge(..., merge.WithOverride). It will override "non-empty" attributes, which is desired in most use cases. (e.g. intentional override some int field to 0).
I did not find a way to differentiate "user assigned zero value" vs "automatic zero value" in a struct. If there is, then adding a custom mergo.Transformers might do.
System (please complete the following information):
windows
1.20
2.2.3
Describe the bug
When loading config from Files
configuration is appended but when using
LoadData()
is overriding by last sourceTo Reproduce
Current behavior
Expected behavior
LoadData
Merges all data loaded by parameter listAdditional context
If needed some more explanation, code or screens, fell free to write.
If there is any other method to load data like from files but from source maps or maybe there is possibility to create something like
Merge(any...)
The text was updated successfully, but these errors were encountered: