mattes / migrate

Database migrations. CLI and Golang library.
Other
2.29k stars 326 forks source link

gofmt #352

Open whilei opened 6 years ago

whilei commented 6 years ago

Just ran

gofmt -w .

on the project root. That's all.

https://blog.golang.org/go-fmt-your-code


I made this PR with a project going on over at https://github.com/rotblauer/gofmt-att, and it's definitely a work in progress. So if I got something wrong, or this is annoying at all, please file an issue over there and we'll sort it out.

JensRantil commented 6 years ago

How about we run gofmt in CI to make sure that we adhere to this forever?

whilei commented 6 years ago

My only adviso for that is https://golang.org/doc/go1.10#gofmt

Note that these kinds of minor updates to gofmt are expected from time to time. In general, we recommend against building systems that check that source code matches the output of a specific version of gofmt. For example, a continuous integration test that fails if any code already checked into a repository is not “properly formatted” is inherently fragile and not recommended.

If multiple programs must agree about which version of gofmt is used to format a source file, we recommend that they do this by arranging to invoke the same gofmt binary. For example, in the Go open source repository, our Git pre-commit hook is written in Go and could import go/format directly, but instead it invokes the gofmt binary found in the current path, so that the pre-commit hook need not be recompiled each time gofmt changes.