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:
Damien Neil 2018-10-04 17:31:07 -07:00
parent a4a765351c
commit 329b75ece9

View File

@ -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)