From d05c5c52fc57688a2a3b35392a560eba48421549 Mon Sep 17 00:00:00 2001 From: "devsy-app[bot]" <277138668+devsy-app[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:08:20 +0000 Subject: [PATCH] fix: export crane command type Export the crane command type so New returns an exported *Command, resolving the Codefactor maintainability issue (exported func returns unexported type). --- pkg/devcontainer/crane/run.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/devcontainer/crane/run.go b/pkg/devcontainer/crane/run.go index 66da6d353..06b275a8c 100644 --- a/pkg/devcontainer/crane/run.go +++ b/pkg/devcontainer/crane/run.go @@ -29,27 +29,27 @@ type Content struct { Files map[string]string `json:"files"` } -type command struct { +type Command struct { cmd string args []string } -func New(cmd string) *command { - newCommand := &command{cmd: getBinName()} +func New(cmd string) *Command { + newCommand := &Command{cmd: getBinName()} return newCommand.WithArg(cmd) } -func (c *command) WithFlag(flag, val string) *command { +func (c *Command) WithFlag(flag, val string) *Command { c.args = append(c.args, flag, val) return c } -func (c *command) WithArg(arg string) *command { +func (c *Command) WithArg(arg string) *Command { c.args = append(c.args, arg) return c } -func (c *command) Run() (string, error) { +func (c *Command) Run() (string, error) { cmd := exec.Command(c.cmd, c.args...) var outBuf, errBuf bytes.Buffer @@ -85,15 +85,15 @@ func PullConfigFromSource( return "", fmt.Errorf("failed to pull config from source based on options") } - command := New(PullCommand). + cmd := New(PullCommand). WithArg(EnvironmentCrane). WithArg(options.Platform.EnvironmentTemplate) if options.Platform.EnvironmentTemplateVersion != "" { - command = command.WithFlag("--version", options.Platform.EnvironmentTemplateVersion) + cmd = cmd.WithFlag("--version", options.Platform.EnvironmentTemplateVersion) } - data, err = command.Run() + data, err = cmd.Run() if err != nil { return "", err }