Document intentional error suppressions with comments (gt-zn9m)
All 156 instances of _ = error suppression in non-test code now have explanatory comments documenting why the error is intentionally ignored. Categories of intentional suppressions: - non-fatal: session works without these - tmux environment setup - non-fatal: theming failure does not affect operation - visual styling - best-effort cleanup - defer cleanup on failure paths - best-effort notification - mail/notifications that should not block - best-effort interrupt - graceful shutdown attempts - crypto/rand.Read only fails on broken system - random ID generation - output errors non-actionable - fmt.Fprint to io.Writer This addresses the silent failure and debugging concerns raised in the issue by making the intentionality explicit in the 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:
@@ -241,7 +241,7 @@ func init() {
|
||||
mailSendCmd.Flags().BoolVar(&mailWisp, "wisp", true, "Send as wisp (ephemeral, default)")
|
||||
mailSendCmd.Flags().BoolVar(&mailPermanent, "permanent", false, "Send as permanent (not ephemeral, synced to remote)")
|
||||
mailSendCmd.Flags().BoolVar(&mailSendSelf, "self", false, "Send to self (auto-detect from cwd)")
|
||||
_ = mailSendCmd.MarkFlagRequired("subject")
|
||||
_ = mailSendCmd.MarkFlagRequired("subject") // cobra flags: error only at runtime if missing
|
||||
|
||||
// Inbox flags
|
||||
mailInboxCmd.Flags().BoolVar(&mailInboxJSON, "json", false, "Output as JSON")
|
||||
@@ -949,6 +949,6 @@ func runMailReply(cmd *cobra.Command, args []string) error {
|
||||
// generateThreadID creates a random thread ID for new message threads.
|
||||
func generateThreadID() string {
|
||||
b := make([]byte, 6)
|
||||
_, _ = rand.Read(b)
|
||||
_, _ = rand.Read(b) // crypto/rand.Read only fails on broken system
|
||||
return "thread-" + hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user