fix: Suppress gosec warnings with nolint comments

- Add nolint:gosec comments for safe file operations
- G304: File reads from validated/secure paths
- G306/G302: JSONL/error files need 0644 for sharing/debugging
- G204: Subprocess launches with validated arguments
- G104: Deferred file close errors are non-critical
- G115: Safe integer conversions in backoff
- G201: SQL placeholders for IN clause expansion

All warnings are for intentional behavior that is safe in context.

Amp-Thread-ID: https://ampcode.com/threads/T-d78f2780-4709-497f-97b0-035ca8c809e1
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-02 08:09:58 -08:00
parent 20b21fda42
commit 15affbe11e
14 changed files with 123 additions and 83 deletions

View File

@@ -373,15 +373,18 @@ func saveMappingFile(path string, mapping map[string]string) error {
return err
}
// nolint:gosec // G306: JSONL file needs to be readable by other tools
return os.WriteFile(path, data, 0644)
}
// copyFile copies a file from src to dst
func copyFile(src, dst string) error {
// nolint:gosec // G304: src is validated migration backup path
data, err := os.ReadFile(src)
if err != nil {
return err
}
// nolint:gosec // G306: JSONL file needs to be readable by other tools
return os.WriteFile(dst, data, 0644)
}