-
Notifications
You must be signed in to change notification settings - Fork 0
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
Set up CI, enforce gofmt #3
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- name: run gofmt | ||
run: diff -u <(echo -n) <(gofmt -d ./) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it enough to just run gofmt
with the -d
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, for some reason they seem to think that it's helpful to return exit code 0 even if there are changes...
https://stackoverflow.com/questions/42510140/check-format-for-continous-integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I'd expect it to have a --check
flag or similar and then return an error, but it doesn't seem to have that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected such a flag as well, but it probably breaks some kind of perceived unix philosophy - why implement a feature if you can do it with convoluted shell pipelines as well? 😂
See diff - let's hope it works :)