Skip to content

Commit 28a32e2

Browse files
committed
chore: lint
1 parent d020273 commit 28a32e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libvirt/dialers/sshcmd.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (d *SSHCmdDialer) Dial() (net.Conn, error) {
243243
<-ctx.Done()
244244
// Process monitoring is done, clean up
245245
if cmd.Process != nil {
246-
if err := cmd.Process.Kill();err != nil {
246+
if err := cmd.Process.Kill(); err != nil {
247247
log.Printf("[ERROR] Failed to kill ssh command: %v", err)
248248
}
249249
}
@@ -258,6 +258,7 @@ func (d *SSHCmdDialer) Dial() (net.Conn, error) {
258258
}()
259259

260260
// Wait for initial connection (give ssh some time to establish the connection)
261+
//nolint:mnd
261262
time.Sleep(100 * time.Millisecond)
262263
if cmd.ProcessState != nil && cmd.ProcessState.Exited() {
263264
return nil, fmt.Errorf("ssh command terminated prematurely with exit code %d", cmd.ProcessState.ExitCode())
@@ -330,12 +331,14 @@ func (d *SSHCmdDialer) buildSSHArgs() []string {
330331

331332
case ProxyNetcat:
332333
// Netcat mode - detect proper flags for netcat
334+
//nolint:lll
333335
shellCmd = fmt.Sprintf("sh -c 'if \"%s\" -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then ARG=-q0; else ARG=; fi; \"%s\" $ARG -U %s'",
334336
d.netcatBin, d.netcatBin, d.socket)
335337
log.Printf("[DEBUG] Using netcat %s for socket connection to %s", d.netcatBin, d.socket)
336338

337339
case ProxyAuto:
338340
// Auto mode - try virt-ssh-helper first, then fall back to netcat
341+
//nolint:lll
339342
shellCmd = fmt.Sprintf("sh -c 'which virt-ssh-helper 1>/dev/null 2>&1; if test $? = 0; then virt-ssh-helper \"%s\"; else if \"%s\" -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then ARG=-q0; else ARG=; fi; \"%s\" $ARG -U %s; fi'",
340343
d.remoteURI, d.netcatBin, d.netcatBin, d.socket)
341344
log.Printf("[DEBUG] Using auto proxy mode with URI: %s", d.remoteURI)

0 commit comments

Comments
 (0)