fix(fileutil): explicitly ignore Close() error on directory file descriptor

This commit is contained in:
程智超0668000959 2026-06-15 20:25:04 +08:00
parent df753aaebf
commit d2156a982c

View file

@ -110,7 +110,7 @@ func WriteFileAtomic(path string, data []byte, perm os.FileMode) error {
// This prevents the renamed file from disappearing after a crash // This prevents the renamed file from disappearing after a crash
if dirFile, err := os.Open(dir); err == nil { if dirFile, err := os.Open(dir); err == nil {
_ = dirFile.Sync() _ = dirFile.Sync()
dirFile.Close() _ = dirFile.Close()
} }
// Success: skip cleanup (file was renamed, no temp to remove) // Success: skip cleanup (file was renamed, no temp to remove)