build: remove error return from genMainModule
The genMainModule function never returns an error, so simplified its signature to return only Package. Updated: - genMainModule signature: (Package, error) -> Package - Call site in build.go to not handle error - Both test cases to remove error checking Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: cpunion <8459+cpunion@users.noreply.github.com>
This commit is contained in:
@@ -782,10 +782,7 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, outputPa
|
||||
}
|
||||
})
|
||||
// Generate main module file (needed for global variables even in library modes)
|
||||
entryPkg, err := genMainModule(ctx, llssa.PkgRuntime, pkg, needRuntime, needPyInit)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
entryPkg := genMainModule(ctx, llssa.PkgRuntime, pkg, needRuntime, needPyInit)
|
||||
entryObjFile, err := exportObject(ctx, entryPkg.PkgPath, entryPkg.ExportFile, []byte(entryPkg.LPkg.String()))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user