Working on a nifty tool to generate parts of my .go code (I’ll write more on that later), one of my team mates working on a Windows machine was unable to get the files generated properly. Looking at the output, it seemed like \r\n Windows linefeed issue.
_gen.go/23 12:52:11 MySqlGenerator: Writing to: mysql_AnEntity
What should have been at the end of the line came up front and that’s highly indicative of a \r. Parameters also were not being recognized properly as it appended the \r to that also.
We tried adding an empty space at the end, but SublimeText always truncated it. Apparently, setting “trim_trailing_white_space_on_save” to false in the settings should have avoided that, but it just doesn’t. (Is that a bug in SublimeText?)
We then set the SublimeText option “default_line_ending” to “unix”. Even that didn’t work very well because SublimeText will apparently set that only for new files.
Finally we installed a SublimeText plugin https://github.com/titoBouzout/LineEndings which allowed us to save all files in the unix format on windows also.
Now, it’s ok.
p.s. One other point I’m going to note is how we had to specifically set GOBIN environment variable where the installable will be automatically put on ‘go install’ of the generator utility.
