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

@@ -251,24 +251,24 @@ func (g *Git) CheckConflicts(source, target string) ([]string, error) {
conflicts, err := g.getConflictingFiles()
if err == nil && len(conflicts) > 0 {
// Abort the test merge
g.AbortMerge()
_ = g.AbortMerge()
return conflicts, nil
}
// Check if it's a conflict error from wrapper
if errors.Is(mergeErr, ErrMergeConflict) {
g.AbortMerge()
_ = g.AbortMerge()
return conflicts, nil
}
// Some other merge error
g.AbortMerge()
_ = g.AbortMerge()
return nil, mergeErr
}
// Merge succeeded (no conflicts) - abort the test merge
// Use reset since --abort won't work on successful merge
g.run("reset", "--hard", "HEAD")
_, _ = g.run("reset", "--hard", "HEAD")
return nil, nil
}

View File

@@ -21,10 +21,10 @@ func initTestRepo(t *testing.T) string {
// Configure user for commits
cmd = exec.Command("git", "config", "user.email", "test@test.com")
cmd.Dir = dir
cmd.Run()
_ = cmd.Run()
cmd = exec.Command("git", "config", "user.name", "Test User")
cmd.Dir = dir
cmd.Run()
_ = cmd.Run()
// Create initial commit
testFile := filepath.Join(dir, "README.md")
@@ -33,10 +33,10 @@ func initTestRepo(t *testing.T) string {
}
cmd = exec.Command("git", "add", ".")
cmd.Dir = dir
cmd.Run()
_ = cmd.Run()
cmd = exec.Command("git", "commit", "-m", "initial")
cmd.Dir = dir
cmd.Run()
_ = cmd.Run()
return dir
}