Skip to content

Commit ab1afbd

Browse files
committed
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]>
1 parent 8bc8593 commit ab1afbd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cmd/compose/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ func runBuild(ctx context.Context, dockerCli command.Cli, backend api.Service, o
160160
}
161161

162162
apiBuildOptions, err := opts.toAPIBuildOptions(services)
163-
apiBuildOptions.Attestations = true
164163
if err != nil {
165164
return err
166165
}
166+
apiBuildOptions.Attestations = true
167167

168168
return backend.Build(ctx, project, apiBuildOptions)
169169
}

cmd/compose/commit.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,13 @@ func runCommit(ctx context.Context, dockerCli command.Cli, backend api.Service,
7979
return err
8080
}
8181

82-
commitOptions := api.CommitOptions{
82+
return backend.Commit(ctx, projectName, api.CommitOptions{
8383
Service: options.service,
8484
Reference: options.reference,
8585
Pause: options.pause,
8686
Comment: options.comment,
8787
Author: options.author,
8888
Changes: options.changes,
8989
Index: options.index,
90-
}
91-
92-
return backend.Commit(ctx, projectName, commitOptions)
90+
})
9391
}

0 commit comments

Comments
 (0)