fix: resolve golangci-lint warnings
- Handle ignored errors with explicit _ assignment (errcheck) - Add #nosec comments for false positive G304/G204 warnings (gosec) - Fix misspelling: cancelled -> canceled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+5
-5
@@ -1019,7 +1019,7 @@ func pruneExpiredTombstones() (*TombstonePruneResult, error) {
|
||||
}
|
||||
allIssues = append(allIssues, &issue)
|
||||
}
|
||||
file.Close()
|
||||
_ = file.Close() // Best effort close, already read all data
|
||||
|
||||
// Determine TTL
|
||||
ttl := types.DefaultTombstoneTTL
|
||||
@@ -1052,20 +1052,20 @@ func pruneExpiredTombstones() (*TombstonePruneResult, error) {
|
||||
encoder := json.NewEncoder(tempFile)
|
||||
for _, issue := range kept {
|
||||
if err := encoder.Encode(issue); err != nil {
|
||||
tempFile.Close()
|
||||
os.Remove(tempPath)
|
||||
_ = tempFile.Close()
|
||||
_ = os.Remove(tempPath) // Best effort cleanup
|
||||
return nil, fmt.Errorf("failed to write issue %s: %w", issue.ID, err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := tempFile.Close(); err != nil {
|
||||
os.Remove(tempPath)
|
||||
_ = os.Remove(tempPath) // Best effort cleanup
|
||||
return nil, fmt.Errorf("failed to close temp file: %w", err)
|
||||
}
|
||||
|
||||
// Atomically replace
|
||||
if err := os.Rename(tempPath, issuesPath); err != nil {
|
||||
os.Remove(tempPath)
|
||||
_ = os.Remove(tempPath) // Best effort cleanup
|
||||
return nil, fmt.Errorf("failed to replace issues.jsonl: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user