Skip to content

Commit

Permalink
Only log it the first time a package is added
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Jan 28, 2024
1 parent 72cc2ce commit d68a6f2
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions v2/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,26 +388,29 @@ func (p *Parser) addPkgToUniverse(pkg *packages.Package, u *types.Universe) erro
return nil
}

// We're keeping this package, though we might not fully process it.
if vlog := klog.V(5); vlog.Enabled() {
why := "user-requested"
if !p.userRequested[pkgPath] {
why = "dependency"
// This will get-or-create the Package.
gengoPkg := u.Package(pkgPath)

if gengoPkg.Dir == "" {
// We're keeping this package, though we might not fully process it.
if vlog := klog.V(5); vlog.Enabled() {
why := "user-requested"
if !p.userRequested[pkgPath] {
why = "dependency"
}
vlog.Infof("addPkgToUniverse %q (%s)", pkgPath, why)
}
vlog.Infof("addPkgToUniverse %q (%s)", pkgPath, why)
}

absPath := ""
if dir, err := packageDir(pkg); err != nil {
return err
} else {
absPath = dir
}
absPath := ""
if dir, err := packageDir(pkg); err != nil {
return err
} else {
absPath = dir
}

// This will get-or-create the Package.
gengoPkg := u.Package(pkgPath)
gengoPkg.Path = pkg.PkgPath
gengoPkg.Dir = absPath
gengoPkg.Path = pkg.PkgPath
gengoPkg.Dir = absPath
}

// If the package was not user-requested, we can stop here.
if !p.userRequested[pkgPath] {
Expand Down

0 comments on commit d68a6f2

Please sign in to comment.