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
I'm reading a single config file where I want to override values based on priority. My initial code below worked with 1.1.0, but does not with 1.3.0. I understand that some functions have been marked deprecated in 1.3.0, but the README explicitly states that "no breaking changes will be made in the 1.x series of releases".
I see that the new NewYAML function can take multiple files with priority, but I want to read and merge a single file. Is there another way to do this in 1.3.0?
@tormoder Apologies for a long turn-around. This seems to have slipped under the cracks.
It's not entirely clear what you are trying to do since you're doing overrides in the same file. I can only assume that you have some sort of a base configuration object and you introduce new flavors as you go along. If that is the case, you can use YAML itself, rather than relying on the config library.
The Go yaml parser supports anchors as far as I can tell (although I've never used it in any meaningful capacity).
Here is an example.
Config file that has an object with base values and a,b that inherit and override values.
I'm reading a single config file where I want to override values based on priority. My initial code below worked with 1.1.0, but does not with 1.3.0. I understand that some functions have been marked deprecated in 1.3.0, but the README explicitly states that "no breaking changes will be made in the 1.x series of releases".
I see that the new
NewYAML
function can take multiple files with priority, but I want to read and merge a single file. Is there another way to do this in 1.3.0?Reproduction:
config.yml file:
main.go:
Result using 1.1.0:
Foo: "Override"
Result using 1.3.0:
Foo: ""
The text was updated successfully, but these errors were encountered: