patch: Clone/Merge

This commit is contained in:
xushiwei
2024-06-28 15:14:30 +08:00
parent 2165941026
commit fe18c35dab
6 changed files with 78 additions and 70 deletions

View File

@@ -132,8 +132,8 @@ func (p *context) importPkg(pkg *types.Package, i *pkgInfo) {
scope := pkg.Scope()
kind, _ := pkgKindByScope(scope)
if kind == PkgNormal {
if alt, ok := p.patches[pkgPath]; ok {
pkg = alt.Pkg
if patch, ok := p.patches[pkgPath]; ok {
pkg = patch.Alt.Pkg
scope = pkg.Scope()
if kind, _ = pkgKindByScope(scope); kind != PkgNormal {
goto start