Skip to content

Commit

Permalink
log LoadPkgs message
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 19, 2021
1 parent b82a2fd commit ddcd2b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions import.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,17 @@ func pkgPathNotFound(allPkgPaths []string, pkgPath string) bool {
}

func (p *Package) endImport() {
if len(p.delayPkgPaths) == 0 {
pkgPaths := p.delayPkgPaths
if len(pkgPaths) == 0 {
return
}
if n := p.loadPkgs(p, p.importPkgs, p.delayPkgPaths...); n > 0 {
if debugImport {
log.Println("==> LoadPkgs", pkgPaths)
}
if n := p.loadPkgs(p, p.importPkgs, pkgPaths...); n > 0 {
log.Panicf("total %d errors\n", n) // TODO: error message
}
p.delayPkgPaths = p.delayPkgPaths[:0]
p.delayPkgPaths = pkgPaths[:0]
}

func (p *Package) getDecls() (decls []ast.Decl) {
Expand Down

0 comments on commit ddcd2b3

Please sign in to comment.