1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:04:41 -07:00
go/imports
LE Manh Cuong b23eb6252f imports: fixup comments on import lines correctly
The current implementation uses the added import specs EndPos to fixup
the comments position after import specs is sorted. If two or more
import specs have the same EndPos, a comment associated with one of them
is always added to the last import spec.

This commit uses the current import spec position to compute new
position for next import spec. So there is never two or more specs have
the same EndPos.

Fixes golang/go#23709

Change-Id: I60ace9431d871e94a2b3d90892aa80d0671aeea0
Reviewed-on: https://go-review.googlesource.com/121878
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-02 20:27:37 +00:00
..
fix_test.go imports: fixup comments on import lines correctly 2018-07-02 20:27:37 +00:00
fix.go imports: skip $GOPATH/src/v and $GOPATH/src/mod 2018-06-17 21:38:49 +00:00
imports.go imports: Process should accept nil src 2018-04-12 23:47:31 +00:00
mkindex.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
mkstdlib.go imports: update zstdlib to Go 1.10 2018-02-10 03:09:51 +00:00
sortimports.go imports: fixup comments on import lines correctly 2018-07-02 20:27:37 +00:00
zstdlib.go imports: update zstdlib to Go 1.10 2018-02-10 03:09:51 +00:00