Not too sure with only a quick view on it, but my first guess would be that it's probably the difference of a *Element reference to a Element copy.
Meaning you are altering command.Element but rootElement.Elements might contain a different object.
Try putting rootElement.Elements = append(rootElement.Elements, commandElement) after the VisitAll.
After thinking about my go issue i think you are right, when i added the command element to the root command, it took a copy of my variable and stored it.
So all the changes i did after got lost. Not that it matters your solution was much better than mine :).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Not too sure with only a quick view on it, but my first guess would be that it's probably the difference of a
*Elementreference to aElementcopy.Meaning you are altering
command.Elementbut rootElement.Elements might contain a different object.Try putting
rootElement.Elements = append(rootElement.Elements, commandElement)after theVisitAll.Thanks for your help I managed to get a export running after finding the
carapace-binrepo!!Ah yes, might get a bit lost in the text. For everyone else: github.com/rsteube/carapace-bin
After thinking about my go issue i think you are right, when i added the command element to the root command, it took a copy of my variable and stored it.
So all the changes i did after got lost. Not that it matters your solution was much better than mine :).