mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: address golangci 'errcheck' issues
Many reports are about closing or removing files. In some cases it is possible to report an error in the logs, in other cases the error can be ignored without potential issues. Test cases have been modified to not remove the temporary files. The temporary directory that is provided by the testing package, is removed once the tests are done. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
0a22e3a186
commit
bc8b1e792f
@ -135,7 +135,7 @@ func fsyncEncryptedDirectory(dirPath string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer dir.Close()
|
||||
defer dir.Close() //nolint:errcheck // still open? sync may have returned an error too
|
||||
|
||||
return dir.Sync()
|
||||
}
|
||||
@ -284,7 +284,7 @@ func getInodeEncryptedAttribute(p string) (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
defer file.Close()
|
||||
defer file.Close() //nolint:errcheck // failed to close, assume SYS_IOCTL returned an error too
|
||||
|
||||
var attr int
|
||||
_, _, errno := unix.Syscall(unix.SYS_IOCTL, file.Fd(), unix.FS_IOC_GETFLAGS,
|
||||
|
Reference in New Issue
Block a user