Open bbrowning opened 7 years ago
Here's an example of how gofmt would change the existing code - https://github.com/bbrowning/funktion/commit/076935a8bc7b09d0cbe528c4f0d6790c22407b8e
It's mainly consistent whitespace and import ordering changes.
Good idea! We should probably hack the Makefile to invoke it - maybe on the test target?
Most projects set up CI validation for this.
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 "")
@maleck13 that'd be awesome if you could thanks!
Many Golang project use
gofmt
to consistently format their Go code. And, it's not uncommon to setup your editor to automatically rungofmt
when saving changes to a file. Perhaps we should consider doing so as well?