Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4636)

Issue 139430043: code review 139430043: go/printer, gofmt: don't align map entries for irregula... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 7 months ago by gri
Modified:
9 years, 7 months ago
Reviewers:
gobot, adonovan
CC:
adonovan, golang-codereviews
Visibility:
Public.

Description

go/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/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -7 lines) Patch
M src/go/printer/nodes.go View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -6 lines 0 comments Download
M src/go/printer/testdata/declarations.golden View 1 2 3 4 5 6 2 chunks +24 lines, -1 line 0 comments Download
M src/go/printer/testdata/declarations.input View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 5
gri
Hello adonovan@google.com (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 7 months ago (2014-09-09 23:34:43 UTC) #1
adonovan
LGTM https://codereview.appspot.com/139430043/diff/140001/src/go/printer/nodes.go File src/go/printer/nodes.go (right): https://codereview.appspot.com/139430043/diff/140001/src/go/printer/nodes.go#newcode210 src/go/printer/nodes.go:210: needsLinebreak := prevLine < line && prevLine > ...
9 years, 7 months ago (2014-09-11 19:49:52 UTC) #2
gri
*** Submitted as https://code.google.com/p/go/source/detail?r=33cc143edd97 *** go/printer, gofmt: don't align map entries for irregular inputs Details: ...
9 years, 7 months ago (2014-09-11 19:57:57 UTC) #3
gobot
This CL appears to have broken the netbsd-amd64-bsiegert builder. See http://build.golang.org/log/37226bd4a87b4b32447d7920ed57c85ef5da1d49
9 years, 7 months ago (2014-09-11 20:32:42 UTC) #4
gri
9 years, 7 months ago (2014-09-11 20:50:43 UTC) #5
Message was sent while issue was closed.

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b