Browse Source

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>
Damien Neil 7 years ago
parent
commit
329b75ece9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      protogen/protogen.go

+ 1 - 1
protogen/protogen.go

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