mattermost-plugin-starter-template
mattermost-plugin-starter-template copied to clipboard
Windows: go fmt will fail the build because of line endings
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
-wflag ofgo fmt, which will actually change the file during build and fix the formatting