summaryrefslogtreecommitdiff
path: root/src/pkg/go/printer/testdata/expressions.raw
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-10-22 10:03:14 -0700
committerRobert Griesemer <gri@golang.org>2010-10-22 10:03:14 -0700
commit92e109e978267c447be0fd18141ea591d5019f47 (patch)
tree986247d684a3b913b70efd13a2bec67a6acbf189 /src/pkg/go/printer/testdata/expressions.raw
parent7ad5db723e7f3e7cdb0ba3227627a430393057bc (diff)
downloadgo-92e109e978267c447be0fd18141ea591d5019f47.tar.gz
go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible R=rsc CC=golang-dev http://codereview.appspot.com/2319041
Diffstat (limited to 'src/pkg/go/printer/testdata/expressions.raw')
-rw-r--r--src/pkg/go/printer/testdata/expressions.raw21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pkg/go/printer/testdata/expressions.raw b/src/pkg/go/printer/testdata/expressions.raw
index e571d0828..62be00cc3 100644
--- a/src/pkg/go/printer/testdata/expressions.raw
+++ b/src/pkg/go/printer/testdata/expressions.raw
@@ -277,6 +277,27 @@ func _() {
func _() {
+ _ = [][]int{
+ []int{1},
+ []int{1, 2},
+ []int{1, 2, 3},
+ }
+ _ = [][]int{
+ {1},
+ []int{1, 2},
+ []int{1, 2, 3},
+ }
+ _ = [][]int{
+ {1},
+ {1, 2},
+ {1, 2, 3},
+ }
+ _ = [][]int{{1}, {1, 2}, {1, 2, 3}}
+}
+
+
+// various multi-line expressions
+func _() {
// do not add extra indentation to multi-line string lists
_ = "foo" + "bar"
_ = "foo" +