Skip to content

Commit

Permalink
initGopPkg
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Aug 19, 2021
1 parent 4e6239c commit 5d89e6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions import.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ func LoadGoPkg(at *Package, imports map[string]*PkgRef, loadPkg *packages.Packag
}
pkg, ok := imports[loadPkg.PkgPath]
pkgTypes := loadPkg.Types
if pkgTypes.Scope().Lookup("GopPackage") != nil { // is a Go+ package
initGopPkg(pkgTypes)
}
initGopPkg(pkgTypes)
if ok {
if pkg.ID == "" {
pkg.ID = loadPkg.ID
Expand Down Expand Up @@ -188,6 +186,9 @@ func calcFingerp(files []string) string {
}

func initGopPkg(pkg *types.Package) {
if pkg.Scope().Lookup("GopPackage") == nil { // not is a Go+ package
return
}
type omthd struct {
named *types.Named
mthd string
Expand Down
1 change: 1 addition & 0 deletions persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ func fromPersistPkg(ctx *persistPkgCtx, pkg *persistPkgRef) *PkgRef {
o := fromPersistFunc(ctx, fn)
ctx.scope.Insert(o)
}
initGopPkg(ctx.pkg)
return ret
}

Expand Down

0 comments on commit 5d89e6b

Please sign in to comment.