Merge lp:~jtv/gwacl/gofmt-simplify into lp:gwacl
Proposed by
Jeroen T. Vermeulen
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | 73 |
Merged at revision: | 76 |
Proposed branch: | lp:~jtv/gwacl/gofmt-simplify |
Merge into: | lp:gwacl |
Diff against target: |
124 lines (+19/-19) 4 files modified
poller_test.go (+4/-4) storage_test.go (+8/-8) test_helpers.go (+1/-1) xmlobjects_test.go (+6/-6) |
To merge this branch: | bzr merge lp:~jtv/gwacl/gofmt-simplify |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+156098@code.launchpad.net |
Commit message
Clean up some small nuisances using gofmt's -s ("simplify") option.
Description of the change
Maybe we should always run this as part of formatting: gofmt's “-s” option streamlines the code a bit.
I also tried it on gomaasapi and even juju-core, and the only things I saw it clean up were:
1. Unneeded specifications on initializers, such as array literals inside array literals. That's what you see here.
2. Use of “_” as the optional second iteration output: “for x, _ := range y” becomes “for x := range y”.
So it looks pretty safe. There are also options to list files that gofmt _would_ change if you allowed it to, and for showing what changes it would like to make.
Jeroen
To post a comment you must log in.
Looks good! I didn't know that option existed.
> Maybe we should always run this as part of formatting: gofmt's “-s” option streamlines the code a bit.
I think we should.