diff options
Diffstat (limited to 'src/pkg/go/printer/testdata/declarations.input')
-rw-r--r-- | src/pkg/go/printer/testdata/declarations.input | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/pkg/go/printer/testdata/declarations.input b/src/pkg/go/printer/testdata/declarations.input index d74cff25d..455c0c6c1 100644 --- a/src/pkg/go/printer/testdata/declarations.input +++ b/src/pkg/go/printer/testdata/declarations.input @@ -667,6 +667,35 @@ var _ = map[int]int{ abcde: a, // align with previous line } +// alignment of map composite entries: test cases from issue 3965 +// aligned +var _ = T1{ + a: x, + b: y, + cccccccccccccccccccc: z, +} + +// not aligned +var _ = T2{ + a: x, + b: y, + ccccccccccccccccccccc: z, +} + +// aligned +var _ = T3{ + aaaaaaaaaaaaaaaaaaaa: x, + b: y, + c: z, +} + +// not aligned +var _ = T4{ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: x, + b: y, + c: z, +} + func _() { var _ = T{ @@ -867,3 +896,28 @@ p, q, r string, x ...int) } + +// omit superfluous parentheses in parameter lists +func _((int)) +func _((((((int)))))) +func _(x (int)) +func _(x (((((int)))))) +func _(x, y (int)) +func _(x, y (((((int)))))) + +func _() (int) +func _() ((int)) +func _() ((((((int)))))) + +func _() (x int) +func _() (x (int)) +func _() (x (((((int)))))) + +// special cases: some channel types require parentheses +func _(x chan(<-chan int)) +func _(x (chan(<-chan int))) +func _(x ((((chan(<-chan int)))))) + +func _(x chan<-(chan int)) +func _(x (chan<-(chan int))) +func _(x ((((chan<-(chan int)))))) |