Closed neilwhitlow closed 1 year ago
You have a space in your header and every row on the second column.
This is not being automatically handled. You may want to look into Decoder.NormalizeHeader and Decoder.Map to trim whitespace
Good googly moogly, thanks for this. Cannot believe I didn't try that variation of input.
Apologies if I'm missing something obvious as I'm still relatively new with Go, so highly possible this is user error.
Trying to follow the simple Unmarshal example with a struct that has 2 int fields and the second one is always zero.
I have tried with all positive integers in the second column of the csv and it makes no difference, I'm always seeing zero for the mod field.
Code
Link to Playground
Output
Expected Output