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

Issue 124700043: code review 124700043: cmd/gofmt: fix error on partial Go code ending with lin... (Closed)

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

Description

cmd/gofmt: fix error on partial Go code ending with line comment. Fix issue by always appending newline after user input, before the closing curly bracket. The adjust func is modified to remove this new newline. Add test case (it fails before CL, passes after). Fixes issue 8411.

Patch Set 1 #

Patch Set 2 : diff -r a6a2de805fc04c923e25951334f2a240f9c40db1 https://code.google.com/p/go #

Patch Set 3 : diff -r a6a2de805fc04c923e25951334f2a240f9c40db1 https://code.google.com/p/go #

Total comments: 1

Patch Set 4 : diff -r 8e4e7940943a2dfd0b60db75fac44865005b2271 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M src/cmd/gofmt/gofmt.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
A src/cmd/gofmt/testdata/stdin5.golden View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A src/cmd/gofmt/testdata/stdin5.input View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 12
shurcooL
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
9 years, 8 months ago (2014-08-21 06:59:09 UTC) #1
bradfitz
R=gri On Wed, Aug 20, 2014 at 11:59 PM, <shurcooL@gmail.com> wrote: > Reviewers: golang-codereviews, > ...
9 years, 8 months ago (2014-08-21 17:30:32 UTC) #2
josharian
R=gri https://codereview.appspot.com/124700043/diff/40001/src/cmd/gofmt/gofmt.go File src/cmd/gofmt/gofmt.go (right): https://codereview.appspot.com/124700043/diff/40001/src/cmd/gofmt/gofmt.go#newcode280 src/cmd/gofmt/gofmt.go:280: fsrc := append(append([]byte("package p; func _() {"), src...), ...
9 years, 8 months ago (2014-08-21 17:44:52 UTC) #3
shurcooL
Thanks, for the suggestion. I've considered both. After 45 seconds of thinking, I decided to ...
9 years, 8 months ago (2014-08-21 19:05:04 UTC) #4
josharian
> it scales better if it needs to become 3, 4, 10 characters Build for ...
9 years, 8 months ago (2014-08-21 19:27:01 UTC) #5
gri
I think the gofmt_test.go file needs to be adjusted for the new test to be ...
9 years, 8 months ago (2014-08-21 21:06:15 UTC) #6
shurcooL
The new stdin5 test is picked up without changes to gofmt_test.go. The list of tests ...
9 years, 8 months ago (2014-08-21 22:17:16 UTC) #7
gri
Good point (I need to simplify that test framework). Please address josharian's comment and re-upload. ...
9 years, 8 months ago (2014-08-21 22:33:57 UTC) #8
shurcooL
Hello golang-codereviews@googlegroups.com, bradfitz@golang.org, josharian@gmail.com, gri@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
9 years, 8 months ago (2014-08-22 04:01:16 UTC) #9
gri
LGTM thanks
9 years, 8 months ago (2014-08-22 17:17:51 UTC) #10
gri
*** Submitted as https://code.google.com/p/go/source/detail?r=d1f610e29700 *** cmd/gofmt: fix error on partial Go code ending with line ...
9 years, 8 months ago (2014-08-22 17:18:04 UTC) #11
gobot
9 years, 8 months ago (2014-08-22 17:25:55 UTC) #12
This CL appears to have broken the freebsd-amd64-race builder.
See http://build.golang.org/log/ca53b562677bebbc01df42015607ef93cee2d27c
Sign in to reply to this message.

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