go/printer, gofmt: don't write too many newlines

In some rare cases, gofmt would accept more than the maximum
number of empty lines (1) between source code snippets.

The actual change is in printer.go, lines 773-775; the rest
is some minor restructuring.

Applied gofmt -w src misc .

Fixes #2387.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496047
This commit is contained in:
Robert Griesemer 2011-12-15 13:51:47 -08:00
parent 52c8107a3c
commit 9f65e99ad4
5 changed files with 55 additions and 54 deletions

View file

@ -16,7 +16,6 @@ const N = 10000 // make this bigger for a larger (and slower) test
var data string // test data for write tests
var bytes []byte // test data; same as data but as a slice.
func init() {
bytes = make([]byte, N)
for i := 0; i < N; i++ {