Skip to content

Commit 8f0cf3e

Browse files
jongioCopilot
andcommitted
fix: remove always-nil error return from marshalExecResult
Fixes golangci-lint unparam warning. The error return was never non-nil, so removed it from the signature and updated callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5aa491a commit 8f0cf3e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • cli/src/cmd/exec/commands

cli/src/cmd/exec/commands/mcp.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func handleExecScript(ctx context.Context, args azdext.ToolArgs) (*mcp.CallToolR
183183
cmd.Stderr = &stderr
184184

185185
runErr := cmd.Run()
186-
return marshalExecResult(stdout.String(), stderr.String(), cmd.ProcessState, runErr)
186+
return marshalExecResult(stdout.String(), stderr.String(), cmd.ProcessState, runErr), nil
187187
}
188188

189189
// --- exec_inline handler ---
@@ -221,7 +221,7 @@ func handleExecInline(ctx context.Context, args azdext.ToolArgs) (*mcp.CallToolR
221221
cmd.Stderr = &stderr
222222

223223
runErr := cmd.Run()
224-
return marshalExecResult(stdout.String(), stderr.String(), cmd.ProcessState, runErr)
224+
return marshalExecResult(stdout.String(), stderr.String(), cmd.ProcessState, runErr), nil
225225
}
226226

227227
// --- list_shells handler ---
@@ -310,7 +310,7 @@ type execResult struct {
310310
Error string `json:"error,omitempty"`
311311
}
312312

313-
func marshalExecResult(stdout, stderr string, ps *os.ProcessState, err error) (*mcp.CallToolResult, error) {
313+
func marshalExecResult(stdout, stderr string, ps *os.ProcessState, err error) *mcp.CallToolResult {
314314
result := execResult{
315315
Stdout: stdout,
316316
Stderr: stderr,
@@ -324,7 +324,7 @@ func marshalExecResult(stdout, stderr string, ps *os.ProcessState, err error) (*
324324
result.ExitCode = -1
325325
}
326326
}
327-
return azdext.MCPJSONResult(result), nil
327+
return azdext.MCPJSONResult(result)
328328
}
329329

330330
// buildShellArgs constructs command arguments for the given shell.

0 commit comments

Comments
 (0)