diff options
Diffstat (limited to 'src/pkg/go/printer/testdata/expressions.raw')
-rw-r--r-- | src/pkg/go/printer/testdata/expressions.raw | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/pkg/go/printer/testdata/expressions.raw b/src/pkg/go/printer/testdata/expressions.raw index f1944c94b..735cd943e 100644 --- a/src/pkg/go/printer/testdata/expressions.raw +++ b/src/pkg/go/printer/testdata/expressions.raw @@ -224,11 +224,7 @@ func _() { _ = struct{ x int }{0} _ = struct{ x, y, z int }{0, 1, 2} _ = struct{ int }{0} - _ = struct { - s struct { - int - } - }{struct{ int }{0}} // compositeLit context not propagated => multiLine result + _ = struct{ s struct{ int } }{struct{ int }{0}} } @@ -243,7 +239,8 @@ func _() { _ = `foo bar` _ = `three spaces before the end of the line starting here: -they must not be removed`} +they must not be removed` +} func _() { @@ -256,8 +253,8 @@ bar` var _ = `` var _ = `foo` var _ = - // the next line should not be indented -`foo + // the next line should remain indented + `foo bar` var _ = // comment @@ -265,8 +262,8 @@ bar` var _ = // comment `foo` var _ = // comment - // the next line should not be indented -`foo + // the next line should remain indented + `foo bar` var _ = /* comment */ `` @@ -279,12 +276,12 @@ bar` var _ = /* comment */ `foo` var _ = /* comment */ - // the next line should not be indented -`foo + // the next line should remain indented + `foo bar` var board = []int( -`........... + `........... ........... ....●●●.... ....●●●.... @@ -299,8 +296,8 @@ bar` var state = S{ "foo", - // the next line should not be indented -`........... + // the next line should remain indented + `........... ........... ....●●●.... ....●●●.... @@ -622,3 +619,13 @@ func _() { b.(T). c } + + +// Don't introduce extra newlines in strangely formatted expression lists. +func f() { + // os.Open parameters should remain on two lines + if writer, err = os.Open(outfile, s.O_WRONLY|os.O_CREATE| + os.O_TRUNC,0666); err != nil { + log.Fatal(err) + } +} |