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

Consider formatting code with gofmt #37

Open
bbrowning opened this issue Jan 27, 2017 · 5 comments
Open

Consider formatting code with gofmt #37

bbrowning opened this issue Jan 27, 2017 · 5 comments

Comments

@bbrowning
Copy link
Contributor

Many Golang project use gofmt to consistently format their Go code. And, it's not uncommon to setup your editor to automatically run gofmt when saving changes to a file. Perhaps we should consider doing so as well?

@bbrowning
Copy link
Contributor Author

Here's an example of how gofmt would change the existing code - bbrowning@076935a

It's mainly consistent whitespace and import ordering changes.

@jstrachan
Copy link
Contributor

Good idea! We should probably hack the Makefile to invoke it - maybe on the test target?

@jimmidyson
Copy link

Most projects set up CI validation for this.

@maleck13
Copy link
Contributor

maleck13 commented Apr 5, 2017

We use the following for this in our makefile. Happy to make a PR

check-gofmt:
	diff <(gofmt -d -s .) <(printf "")

.PHONY: check-golint
check-golint:
	diff <(golint ./... | grep -v vendor/) <(printf "")

@jstrachan
Copy link
Contributor

@maleck13 that'd be awesome if you could thanks!

@maleck13 maleck13 mentioned this issue Apr 7, 2017
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

4 participants