compiler: make main function normally to compatible multiple main functions in testing mode

This commit is contained in:
Li Jie
2025-01-13 09:37:26 +08:00
parent 5cfeddef73
commit 85d01d6f28
6 changed files with 64 additions and 72 deletions

View File

@@ -226,9 +226,6 @@ func PathOf(pkg *types.Package) string {
if pkg == nil {
return ""
}
if pkg.Name() == "main" {
return "main"
}
return strings.TrimPrefix(pkg.Path(), PatchPathPrefix)
}