]> Cypherpunks repositories - gostls13.git/commit
go/printer, gofmt: fine tuning of line spacing
authorRobert Griesemer <gri@golang.org>
Fri, 16 Dec 2011 23:43:06 +0000 (15:43 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 16 Dec 2011 23:43:06 +0000 (15:43 -0800)
commit541b67d051fbd26f3727d4d13c6d2b025af8a775
tree6957d10eb2a1e35d13f957015688e4105c6b2a45
parent72bdd8683506807a16b20f5e1be8740e2c258a73
go/printer, gofmt: fine tuning of line spacing

- no empty lines inside empty structs and interfaces
- top-level declarations are separated by a blank line if
  a) they are of different kind (e.g. const vs type); or
  b) there are documentation comments associated with a
     declaration (this is new)
- applied gofmt -w misc src

The actual changes are in go/printer/nodes.go:397-400 (empty structs/interfaces),
and go/printer/printer.go:307-309 (extra line break). The remaining
changes are cleanups w/o changing the existing functionality.

Fixes issue  2570.

R=rsc
CC=golang-dev
https://golang.org/cl/5493057
18 files changed:
src/cmd/gofix/testdata/reflect.type.go.in
src/cmd/gofix/testdata/reflect.type.go.out
src/pkg/crypto/openpgp/keys.go
src/pkg/crypto/x509/x509.go
src/pkg/encoding/gob/codec_test.go
src/pkg/encoding/gob/type.go
src/pkg/exp/ssh/tcpip.go
src/pkg/go/printer/nodes.go
src/pkg/go/printer/printer.go
src/pkg/go/printer/testdata/comments.golden
src/pkg/go/printer/testdata/comments.input
src/pkg/go/printer/testdata/declarations.golden
src/pkg/go/printer/testdata/declarations.input
src/pkg/log/syslog/syslog.go
src/pkg/math/all_test.go
src/pkg/math/sin.go
src/pkg/net/ipraw_test.go
src/pkg/sort/sort.go