fix: Address all errcheck and misspell linter errors

This commit is contained in:
Steve Yegge
2025-11-01 23:56:03 -07:00
parent a2361f85e7
commit 2b086951c4
15 changed files with 61 additions and 60 deletions

View File

@@ -163,7 +163,7 @@ func discoverDaemon(socketPath string) DaemonInfo {
}
return daemon
}
defer client.Close()
defer func() { _ = client.Close() }()
// Get status
status, err := client.Status()
@@ -264,7 +264,7 @@ func StopDaemon(daemon DaemonInfo) error {
// Try graceful shutdown via RPC first
client, err := rpc.TryConnectWithTimeout(daemon.SocketPath, 500*time.Millisecond)
if err == nil && client != nil {
defer client.Close()
defer func() { _ = client.Close() }()
if err := client.Shutdown(); err == nil {
// Wait a bit for daemon to shut down
time.Sleep(200 * time.Millisecond)
@@ -334,7 +334,7 @@ func stopDaemonWithTimeout(daemon DaemonInfo) error {
// Try RPC shutdown first (2 second timeout)
client, err := rpc.TryConnectWithTimeout(daemon.SocketPath, 2*time.Second)
if err == nil && client != nil {
defer client.Close()
defer func() { _ = client.Close() }()
if err := client.Shutdown(); err == nil {
// Wait and verify process died
time.Sleep(500 * time.Millisecond)