fix: suppress gosec G703 false positive on sanitized paths

This commit is contained in:
CarterPerez-dev 2026-03-22 22:28:37 -04:00
parent d246b4a17e
commit e696b084a1
2 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,7 @@ func (u *Updater) Bytes() []byte {
func (u *Updater) WriteFile(path string) error {
path = filepath.Clean(path)
tmp := path + ".tmp"
//nolint:gosec // path sanitized via filepath.Clean
if err := os.WriteFile(tmp, u.content, 0o600); err != nil {
return fmt.Errorf("write temp: %w", err)
}

View File

@ -55,6 +55,7 @@ func UpdateFile(path string, updates map[string]string) error {
path = filepath.Clean(path)
tmp := path + ".tmp"
//nolint:gosec // path sanitized via filepath.Clean
if err := os.WriteFile(tmp, content, 0o600); err != nil {
return fmt.Errorf("write temp: %w", err)
}