go/go2go: support imports that only defines funcs

That case was breaking when looking for a symbol to import to avoid an
unused package error.

Change-Id: I51ccacf36a95a16eac89071d5fa141608b759014
This commit is contained in:
Ian Lance Taylor 2020-03-26 17:27:54 -07:00 committed by Robert Griesemer
parent a31f6ae875
commit 5f4c825cf8
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ func rewriteAST(fset *token.FileSet, importer *Importer, importPath string, file
tok = token.TYPE
importableName = name
break nameLoop
case *types.Var:
case *types.Var, *types.Func:
tok = token.VAR
importableName = name
break nameLoop