I'm coding a simple tool to help myself at work but it's mostly for learning purposes, this tool takes in a ".csv" file and converts the data in the file to sql insert into statements, then write the statements to a ".sql" file. The problem is that after it's done, when I check the file, the last row is never complete, usually it stops
INSERT INTO tablename (field1, field2, field3, field4
I'm using bufio.NewWriter, and the function WriteString, and it's not returning any error, so I have no idea what's happening, the full ".csv" file I'm testing on is 8Kb, but I can't share it because it contains sensible info sorry.
Another problem I'm having is with this particular statement
sqlFile, err := os.Create(date.Format("20-11-2018 20.10.05") + ".sql")
What I try to do here is to put a timestamp as the name of the file with the format "dd-MM-yyyy hh.mm.ss" but the file names end up like this "200-1010-20108 200.100.34.sql", no idea what's happening here.
Before anyone tells me, yes I'm sure there are already tools for this, but a big part of the motivation to do this is to learn, so I welcome any idea or criticism to the entire code and not just the parts I'm having problems with.
Thanks in advance!