You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lint): check all error returns in test and production code
Fixed all unchecked error return values to pass errcheck linter:
1. internal/updater/updater_test.go:
- Added error checks for json.NewEncoder().Encode() calls
- Added error checks for json.NewDecoder().Decode() calls
- Added error checks for http.Response usage before checking errors
- Added error checks for w.Write() in test HTTP handlers
2. internal/updater/updater.go:
- Added error handling for os.Rename() when restoring backup
- Added error handling for os.Remove() when cleaning up backup
- Both use warning messages for non-fatal failures
3. internal/installer/installer.go:
- Added error handling for i.saveState() with warning message
- Ensures state save failures don't block error reporting
4. internal/installer/installer_test.go:
- Added error checks for os.Chdir() in both defer and main call
- Uses proper error handling in defer function
All changes maintain existing behavior while satisfying linter requirements.
Tests pass: go test -v -race ./... ✅
Vet passes: go vet ./... ✅
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments