Descriptiongo/printer, gofmt: don't align map entries for irregular inputs
Details: Until now, when we saw a key:value pair that fit onto
a single line, we assumed that it should be formatted with a
vtab after the ':' for alignment of its value. This leads to
odd behavior if there are more than one such pair on a line.
This CL changes the behavior such that alignment is only used
for the first pair on a line. This preserves existing behavior
(in the std lib we have composite literals where the last line
contains multiple entries and the first entry's value is aligned
with the values on previous lines), and resolves this issue.
No impact on formatting of std lib, go.tools, go.exp, go.net.
Fixes issue 8685.
Patch Set 1 #Patch Set 2 : diff -r faa4ad687ab9d5a217f2b0d4f7a876f4b91623f7 https://code.google.com/p/go/ #Patch Set 3 : diff -r faa4ad687ab9d5a217f2b0d4f7a876f4b91623f7 https://code.google.com/p/go/ #Patch Set 4 : diff -r faa4ad687ab9d5a217f2b0d4f7a876f4b91623f7 https://code.google.com/p/go/ #Patch Set 5 : diff -r faa4ad687ab9d5a217f2b0d4f7a876f4b91623f7 https://code.google.com/p/go/ #Patch Set 6 : diff -r 0eda065231ddc227a5f7ac9bb2aeed9259f8966f https://code.google.com/p/go/ #Patch Set 7 : diff -r 0eda065231ddc227a5f7ac9bb2aeed9259f8966f https://code.google.com/p/go/ #Patch Set 8 : diff -r 0eda065231ddc227a5f7ac9bb2aeed9259f8966f https://code.google.com/p/go/ #
Total comments: 2
Patch Set 9 : diff -r 24fe5ca9df134b6d85d58f836071e9440c1d4bdd https://code.google.com/p/go/ #
MessagesTotal messages: 5
|