mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-09 22:13:27 +00:00
protogen: rewrite _ imports as well
Call the import-rewriting function on _ imports as well as named ones. Change-Id: I2fe2c90fe4b201e96a243f231b54387c6b65f7a5 Reviewed-on: https://go-review.googlesource.com/c/139878 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
a4a765351c
commit
329b75ece9
@ -896,7 +896,7 @@ func (g *GeneratedFile) Content() ([]byte, error) {
|
||||
if _, ok := g.packageNames[importPath]; ok {
|
||||
continue
|
||||
}
|
||||
astutil.AddNamedImport(fset, file, "_", string(importPath))
|
||||
astutil.AddNamedImport(fset, file, "_", rewriteImport(string(importPath)))
|
||||
}
|
||||
ast.SortImports(fset, file)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user