Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mksondej opened this issue Aug 22, 2019 · 0 comments
Open

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

mksondej opened this issue Aug 22, 2019 · 0 comments

Comments

@mksondej
Copy link

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:

gofmt_output=$$(gofmt -d -s $$files 2>&1); \

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant