]> Cypherpunks repositories - gostls13.git/commit
cmd/gofmt: fix error on partial Go code ending with line comment.
authorDmitri Shuralyov <shurcooL@gmail.com>
Fri, 22 Aug 2014 17:18:00 +0000 (10:18 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 22 Aug 2014 17:18:00 +0000 (10:18 -0700)
commit9368d6ccbfe57bc54b433b22b2008d3c4faf086d
treef20533ae028a7360d9934ca99e910dce8e1ced97
parent0be59730fd9339f9c79601ce19a5323828e634c3
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 #8411.

LGTM=gri
R=golang-codereviews, bradfitz, josharian, gri
CC=golang-codereviews
https://golang.org/cl/124700043
src/cmd/gofmt/gofmt.go
src/cmd/gofmt/testdata/stdin5.golden [new file with mode: 0644]
src/cmd/gofmt/testdata/stdin5.input [new file with mode: 0644]