Skip to content
Browse files

export/exporter: ignore import with no package info (#20)

  • Loading branch information...
unknwon committed Aug 13, 2019
1 parent 510027e commit fe9790e39088d915e177319003f9ae3dd50e981a
Showing with 6 additions and 0 deletions.
  1. +6 −0 export/exporter.go
@@ -225,6 +225,12 @@ func (e *exporter) addImports(p *packages.Package, f *ast.File, fi *fileInfo) er
// for any possible consumers. We use trimmed version here only when we need to
// (trimmed version as a map key or an argument).
ipath := strings.Trim(ispec.Path.Value, `"`)
if p.Imports[ipath] == nil {
// There is no package information if the package cannot be located from the
// file system (i.e. missing files of a dependency).

var name string
if ispec.Name == nil {
name = ispec.Path.Value

0 comments on commit fe9790e

Please sign in to comment.
You can’t perform that action at this time.