mirror of https://github.com/golang/go.git
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:
parent
a31f6ae875
commit
5f4c825cf8
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue