Skip to content

Commit

Permalink
Merge pull request #1559 from visualfc/loadmod
Browse files Browse the repository at this point in the history
LoadDir: check mod valid
  • Loading branch information
xushiwei authored Nov 26, 2023
2 parents 911c819 + 4cc93d7 commit 2541a76
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions load.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,16 @@ func LoadDir(dir string, conf *Config, genTestPkg bool, promptGenGo ...bool) (ou

var pkgTest *ast.Package
var clConf = &cl.Config{
WorkingDir: dir,
Fset: fset,
Importer: imp,
LookupClass: mod.LookupClass,
LookupPub: c2go.LookupPub(mod),
FileLineRoot: mod.Root(),
WorkingDir: dir,
Fset: fset,
Importer: imp,
LookupClass: mod.LookupClass,
LookupPub: c2go.LookupPub(mod),
}
if mod.IsValid() {
clConf.FileLineRoot = mod.Root()
}

for name, pkg := range pkgs {
if strings.HasSuffix(name, "_test") {
if pkgTest != nil {
Expand Down

0 comments on commit 2541a76

Please sign in to comment.