fix(lint): resolve all errcheck warnings

Fix ~50 errcheck warnings across the codebase:

- Add explicit `_ =` for intentionally ignored error returns (cleanup,
  best-effort operations, etc.)
- Use `defer func() { _ = ... }()` pattern for defer statements
- Handle tmux SetEnvironment, KillSession, SendKeysRaw returns
- Handle mail router.Send returns
- Handle os.RemoveAll, os.Rename in cleanup paths
- Handle rand.Read returns for ID generation
- Handle fmt.Fprint* returns when writing to io.Writer
- Fix for-select with single case to use for-range
- Handle cobra MarkFlagRequired returns

All tests pass. Code compiles without errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 12:09:52 -08:00
parent 3a477f673c
commit 4048cdc373
29 changed files with 115 additions and 125 deletions

View File

@@ -120,8 +120,8 @@ func (m *Manager) Start(polecat string, opts StartOptions) error {
}
// Set environment
m.tmux.SetEnvironment(sessionID, "GT_RIG", m.rig.Name)
m.tmux.SetEnvironment(sessionID, "GT_POLECAT", polecat)
_ = m.tmux.SetEnvironment(sessionID, "GT_RIG", m.rig.Name)
_ = m.tmux.SetEnvironment(sessionID, "GT_POLECAT", polecat)
// Send initial command
command := opts.Command
@@ -137,9 +137,7 @@ func (m *Manager) Start(polecat string, opts StartOptions) error {
if opts.Issue != "" {
time.Sleep(500 * time.Millisecond)
prompt := fmt.Sprintf("Work on issue: %s", opts.Issue)
if err := m.Inject(polecat, prompt); err != nil {
// Non-fatal, just log
}
_ = m.Inject(polecat, prompt) // Non-fatal error
}
return nil
@@ -161,7 +159,7 @@ func (m *Manager) Stop(polecat string, force bool) error {
// Try graceful shutdown first (unless forced)
if !force {
m.tmux.SendKeysRaw(sessionID, "C-c") // Ctrl+C
_ = m.tmux.SendKeysRaw(sessionID, "C-c") // Ctrl+C
time.Sleep(100 * time.Millisecond)
}