mattermost-plugin-starter-template icon indicating copy to clipboard operation
mattermost-plugin-starter-template copied to clipboard

Windows: go fmt will fail the build because of line endings

Open mksondej opened this issue 6 years ago • 0 comments

On Windows it is not uncommon to setup Git so that it automatically checks-out files with CRLF line endings and commit them with LF. It is the default option when installing Git. Because of those line endings, go fmt in the current setup in the Makefile will always report a difference to expected formatting and fail the build:

https://github.com/mattermost/mattermost-plugin-starter-template/blob/b7165a0f5f30212785a4127cd3a8248ee4f5bb56/Makefile#L51

It may be worth to either:

  • mention this in the docs
  • do not fail the build by default, maybe a warning would be enough?
  • use the -w flag of go fmt, which will actually change the file during build and fix the formatting

mksondej avatar Aug 22 '19 07:08 mksondej