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.