1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:16:10 -07:00
go/imports
Josh Bleecher Snyder 57d2ff39c7 go/ast/astutil: match prefix segments when adding imports
AddImport and AddNamedImport attempt to place new
imports in roughly the correct place--and thus the
correct group--by matching prefixes. Matching prefixes
byte-by-byte led to "regexp" being grouped with "rsc.io/p".
Instead, match prefixes by segments.

Fixes golang/go#9961.

Change-Id: I52b7c58a9a2fbe85c2b5297e50c87d409364bda3
Reviewed-on: https://go-review.googlesource.com/8090
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-03-30 17:57:25 +00:00
..
fix_test.go go/ast/astutil: match prefix segments when adding imports 2015-03-30 17:57:25 +00:00
fix.go astutil: move to go/ast/astutil 2015-01-13 15:47:47 +00:00
imports.go astutil: move to go/ast/astutil 2015-01-13 15:47:47 +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: bake in the standard library again 2014-01-26 09:47:31 -08:00
sortimports_compat.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
sortimports.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
zstdlib.go imports: bake in the standard library again 2014-01-26 09:47:31 -08:00