diff options
| author | Didier Spezia <didier.06@gmail.com> | 2015-06-20 11:25:59 +0000 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2015-06-24 21:45:49 +0000 |
| commit | c68f2f89963cfc9d10b43d33603b6fa588d56f9d (patch) | |
| tree | 966eb7bcab12ca65b63c515ed9c115a34fd159dd /src/runtime/sys_linux_amd64.s | |
| parent | 77082481d48c8cd8ea93328f9ab962092fe0183f (diff) | |
| download | go-c68f2f89963cfc9d10b43d33603b6fa588d56f9d.tar.xz | |
go/format: fix //line corner case when formatting statements
The code formatting mechanism can be applied to partial Go code,
such as a list of statements. The statements are wrapped into a
function definition (to be parsed fine), and unwrapped after formatting.
When the statements contain //line annotations, it may fail,
because not all comments are flushed by the printer before the final '}'.
Formatting "\ta()\n//line :1" results in "\ta() }\n\n//line", which
is wrong.
Tweaked the wrapping/unwrapping code to make sure comments are flushed
before the '}'.
Fixes #11276
Change-Id: Id15c80279b0382ee9ed939cca1647f525c4929f5
Reviewed-on: https://go-review.googlesource.com/11282
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_amd64.s')
0 files changed, 0 insertions, 0 deletions
