daixiang0 / gci

GCI, a tool that control golang package import order and make it always deterministic.
BSD 3-Clause "New" or "Revised" License
433 stars 62 forks source link

Fix line endings for CRLF (windows) #170

Closed SvenGasterstaedt closed 2 months ago

SvenGasterstaedt commented 1 year ago

Fix line endings for windows.

Currently the replacing of line endings is wrong and too late. Rather than replacing "\r\n" which represents a windows line ending only "\r" is replaced resulting in double line endings on files with CRLF-endings.

Unfortunalty just adjusting the replacement from "\r" to "\r\n" breaks the formatting as the parser above also depends on UNIX-lineendings.

TODO:

daixiang0 commented 1 year ago

@SvenGasterstaedt all format is based on UNIX, what do you mean common config not work?