Golang CSV读取:无关的字段错误

I am using a simple program to read CSV file, somehow I noticed when I created a CSV using EXCEL or windows based computer go library fails to read it. even when I use cat command it only shows me last line on the terminal. It always results in this error extraneous " in field.

I researched somewhat than I found it is somewhat related to carriage return differences between OS. But I really want to ask how to make a generic csv reader. I tried reading the same csv using pandas and it was reading successfully. But i am not been able to achieve this using my Go code.

enter image description here

Also screen shot of correct csv Is here

Csv is working fine

Your file clearly shows that you've got an extra quote at the end of the content. While programs like pandas may be fine with that, I assume it's not valid csv so go does return an error.

Quick example of what's wrong with your data: https://play.golang.org/p/KBikSc1nzD

Update: After your update and a little bit of searching, I have to apoligize, the carriage return does matter and seems to be tha main culprit here, Go seems to be ok handling the windows variant but not the one. In that case what you can do is wrap the bytes.Reader into a custom reader that replaces the byte with the byte.

Here's an example: https://play.golang.org/p/vNjzwAHmtg

Please note, that the example is just that, an example, it's not handling all the possible cases where might be a legit byte.