Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

gofmt #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

gofmt #352

wants to merge 1 commit into from

Conversation

whilei
Copy link

@whilei whilei commented Jun 16, 2018

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.

Run standard gofmt command on project root.

- go version go1.10.3 darwin/amd64

Signed-off-by: ia <[email protected]>
@JensRantil
Copy link
Contributor

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

@whilei
Copy link
Author

whilei commented Jun 19, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants