cmd/compose: fix minor linting issues

- inline variable that shadowed package-type
- don't use apiBuildOptions if an error was returned

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This commit is contained in:
Sebastiaan van Stijn
2025-09-29 15:25:22 +02:00
committed by Nicolas De loof
parent 713de5bb9e
commit 4a4776ec57
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -160,10 +160,10 @@ func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, o
}
apiBuildOptions, err := opts.toAPIBuildOptions(services)
apiBuildOptions.Attestations = true
if err != nil {
return err
}
apiBuildOptions.Attestations = true
return backend.Build(ctx, project, apiBuildOptions)
}
+2 -4
View File
@@ -79,7 +79,7 @@ func runCommit(ctx context.Context, dockerCli command.Cli, backend api.Service,
return err
}
commitOptions := api.CommitOptions{
return backend.Commit(ctx, projectName, api.CommitOptions{
Service: options.service,
Reference: options.reference,
Pause: options.pause,
@@ -87,7 +87,5 @@ func runCommit(ctx context.Context, dockerCli command.Cli, backend api.Service,
Author: options.author,
Changes: options.changes,
Index: options.index,
}
return backend.Commit(ctx, projectName, commitOptions)
})
}