]> Cypherpunks repositories - gostls13.git/commit
go/printer: print parenthesized declarations if len(d.Specs) > 1
authorDavid Tolpin <david.tolpin@gmail.com>
Tue, 27 Nov 2018 00:17:32 +0000 (00:17 +0000)
committerRobert Griesemer <gri@golang.org>
Tue, 27 Nov 2018 18:35:40 +0000 (18:35 +0000)
commit7d7e839a76227db321761ca7ca882429f30f39f9
tree38e7e7c5cbcc2ba576ee600908e4b87c4e01ac23
parent0b79dde1128462963db740efd3c9ed98eda2735e
go/printer: print parenthesized declarations if len(d.Specs) > 1

Parenthesized declaration must be printed if len(d.Specs) > 1 even if d.Lparen==token.NoPos. This happens if the node tree is created programmatically. Otherwise, all but the first specifications just silently disappear from the output.

Change-Id: I17ab24bb1cd56fe1e611199698535ca60a97f5ea
GitHub-Last-Rev: 2f168dc7ad4a29149685efc70f180987523271e4
GitHub-Pull-Request: golang/go#28533
Reviewed-on: https://go-review.googlesource.com/c/146657
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/printer/nodes.go
src/go/printer/printer_test.go