3

According to this closed (works as expected) go issue 2242 the expected behaviour of gofmt on Windows is to change all file line endings for you to cr+lf. The behaviour on Posix systems is reverse.

With my git repo set to core.autocrlf true, or with it set to false, I still see in git commit that gofmt has modified line endings, and all files show up as modified.

I am not sure how to get out of this pit of failure. Gofmt is alone in its insane behaviour since no other tool or editor I own does this awful thing to my files.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • I think I might just be stuck with this. I turned on autocrlf globally, then recloned the repo, and the behaviour I abhor is now mitigated. The stupidity that is gofmt is cancelled by the egregious counter horror of autocrlf. – Warren P Oct 06 '16 at 00:05
  • This is a question for the gofmt mailing list or issue tracker, is it not? – Lightness Races in Orbit Oct 08 '16 at 14:54
  • No because its as designed- For non git users like mercurial say the situation is dire – Warren P Oct 08 '16 at 15:28

0 Answers0