New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I merge two yaml files using yq library ? #1967
Comments
There actually isn't a great way to do that at the moment, the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #1966
Originally posted by GeorgeDuckman March 7, 2024
Hello,
I am attempting to use yq as a library in my Golang application. I want to merge two yaml contents that are contained in two different string variables.
I am aware that the yq command can be used to merge two YAML files :
yq -n 'load("file1.yaml") * load("file2.yaml")'
To use yqlib, I am using the StringEvaluator which only takes one input. I am concatenating my two variables into one as follows:
And I want the result to be :
Is there a way to do this ? I would prefer not to create temporary files if possible :)
I've also tried merging by select but it returns nothing.
Here is my minimal code sample if you want to try yourself :
Thank you in advance !
The text was updated successfully, but these errors were encountered: