Add more error handling

This commit is contained in:
Alexander Neumann
2021-01-30 19:35:46 +01:00
parent aef3658a5f
commit 0858fbf6aa
23 changed files with 91 additions and 36 deletions

View File

@@ -19,7 +19,9 @@ func TestPreallocate(t *testing.T) {
flags := os.O_CREATE | os.O_TRUNC | os.O_WRONLY
wr, err := os.OpenFile(path.Join(dirpath, "test"), flags, 0600)
test.OK(t, err)
defer wr.Close()
defer func() {
test.OK(t, wr.Close())
}()
err = preallocateFile(wr, i)
test.OK(t, err)