I am just getting started with Go and for my first mini project trying to write a really simply snippet which will convert xml to csv.
I was able to get the snippet working pretty easily, but I am struggling to handle a simple edge case of missing tag. In the toy example seen on playground link below; when LastName is missing in the second section of XML, I want the snippet to update the slice with a blank string. As it stands now, in event of missing tag the snippet completely ignores the element, which then would cause issues when writing to csv.
Current Lastname Out:
Expected Lastname Out:
[Raboy “” Doe]