Fix lint errors: add error check and gosec suppressions

This commit is contained in:
Steve Yegge
2025-11-05 01:11:09 -08:00
parent 97786e0bf9
commit 52cf2af9f7
4 changed files with 5 additions and 5 deletions

View File

@@ -127,7 +127,7 @@ func (s *SQLiteStorage) exportToRepo(ctx context.Context, repoPath string, issue
// Write atomically using temp file + rename
tempPath := fmt.Sprintf("%s.tmp.%d", jsonlPath, os.Getpid())
f, err := os.Create(tempPath)
f, err := os.Create(tempPath) // #nosec G304 -- tempPath derived from trusted jsonlPath
if err != nil {
return 0, fmt.Errorf("failed to create temp file: %w", err)
}
@@ -161,7 +161,7 @@ func (s *SQLiteStorage) exportToRepo(ctx context.Context, repoPath string, issue
}
// Set file permissions
if err := os.Chmod(jsonlPath, 0644); err != nil {
if err := os.Chmod(jsonlPath, 0644); err != nil { // nolint:gosec // G302: 0644 intentional for git-tracked files
// Non-fatal
if os.Getenv("BD_DEBUG") != "" {
fmt.Fprintf(os.Stderr, "Debug: failed to set permissions on %s: %v\n", jsonlPath, err)