Remove os.Exit() from library code (gt-fm75)

Refactor to return errors instead of calling os.Exit() directly:
- Add SilentExitError type for commands that signal status via exit code
- Update mail.go runMailPeek() and runMailCheck() to return errors
- Change Execute() to return int exit code instead of calling os.Exit()
- Move os.Exit() call to main() where it belongs

This improves testability, enables graceful shutdown, and follows Go
conventions for library code.

🤖 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-30 10:53:10 -08:00
parent 7fdee48807
commit 637f38edca
4 changed files with 53 additions and 17 deletions

View File

@@ -1,8 +1,12 @@
// gt is the Gas Town CLI for managing multi-agent workspaces.
package main
import "github.com/steveyegge/gastown/internal/cmd"
import (
"os"
"github.com/steveyegge/gastown/internal/cmd"
)
func main() {
cmd.Execute()
os.Exit(cmd.Execute())
}