fix(lint): require `exec.CommanadContext` over `exec.Command`

Christian Rocha created

Change summary

internal/cmd/root.go | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Detailed changes

internal/cmd/root.go 🔗

@@ -655,11 +655,11 @@ func startDetachedServer(cmd *cobra.Command, hostURL *url.URL) error {
 		cmdArgs = append(cmdArgs, "--host", clientHost)
 	}
 
-	// Use exec.Command (not exec.CommandContext) so the parent's context
-	// cancellation does not kill the spawned server. detachProcess
-	// (Setsid on !windows, DETACHED_PROCESS on windows) is what truly
-	// detaches the child from this process's lifetime.
-	c := exec.Command(exe, cmdArgs...)
+	// Use context.Background() so the parent's context cancellation does not
+	// kill the spawned server. detachProcess (Setsid on !windows,
+	// DETACHED_PROCESS on windows) is what truly detaches the child from
+	// this process's lifetime.
+	c := exec.CommandContext(context.Background(), exe, cmdArgs...)
 	stdoutPath := filepath.Join(chDir, "stdout.log")
 	stderrPath := filepath.Join(chDir, "stderr.log")
 	detachProcess(c)