Skip to content

Commit

Permalink
cli/command/image: minor cleanups
Browse files Browse the repository at this point in the history
- use apiClient instead of client for the API client to
  prevent shadowing imports.
- use dockerCLI with Go's standard camelCase casing.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Feb 3, 2025
1 parent e81d76f commit 632f179
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cli/command/image/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ func newInspectCommand(dockerCli command.Cli) *cobra.Command {
return cmd
}

func runInspect(ctx context.Context, dockerCli command.Cli, opts inspectOptions) error {
client := dockerCli.Client()
getRefFunc := func(ref string) (any, []byte, error) {
return client.ImageInspectWithRaw(ctx, ref)
}
return inspect.Inspect(dockerCli.Out(), opts.refs, opts.format, getRefFunc)
func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {
apiClient := dockerCLI.Client()
return inspect.Inspect(dockerCLI.Out(), opts.refs, opts.format, func(ref string) (any, []byte, error) {
return apiClient.ImageInspectWithRaw(ctx, ref)
})
}

0 comments on commit 632f179

Please sign in to comment.