Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Oct 8, 2024
1 parent fb4ee19 commit 1bb6e05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions go-runtime/compile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func buildDir(moduleDir string) string {
// Build the given module.
func Build(ctx context.Context, projectRootDir, moduleDir string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, filesTransaction ModifyFilesTransaction, buildEnv []string, devMode bool) (moduleSch *schema.Module, buildErrors []builderrors.Error, err error) {
if err := filesTransaction.Begin(); err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("could not start a file transaction: %w", err)
}
defer func() {
if terr := filesTransaction.End(); terr != nil {
Expand Down Expand Up @@ -319,7 +319,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec
logger.Debugf("Extracting schema")
result, err := extract.Extract(config.Dir)
if err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("could not extract schema: %w", err)
}

if builderrors.ContainsTerminalError(result.Errors) {
Expand All @@ -336,7 +336,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec
}
if err := internal.ScaffoldZip(buildTemplateFiles(), moduleDir, mctx, scaffolder.Exclude("^go.mod$"),
scaffolder.Functions(funcs)); err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("failed to scaffold build template: %w", err)
}

logger.Debugf("Tidying go.mod files")
Expand Down Expand Up @@ -364,7 +364,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec
return filesTransaction.ModifiedFiles(filepath.Join(mainDir, "go.mod"), filepath.Join(moduleDir, "go.sum"))
})
if err := wg.Wait(); err != nil {
return nil, nil, err
return nil, nil, err // nolint:wrapcheck
}

logger.Debugf("Compiling")
Expand Down
2 changes: 1 addition & 1 deletion internal/buildengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ func (e *Engine) build(ctx context.Context, moduleName string, builtModules map[
return err
}
// update files to deploy
e.moduleMetas.Compute(moduleName, func(meta moduleMeta, exists bool) (new moduleMeta, delete bool) {
e.moduleMetas.Compute(moduleName, func(meta moduleMeta, exists bool) (out moduleMeta, shouldDelete bool) {
if !exists {
return moduleMeta{}, true
}
Expand Down

0 comments on commit 1bb6e05

Please sign in to comment.