Skip to content

Commit

Permalink
Merge pull request #228 from fuweid/fs/apply-should-use-sync
Browse files Browse the repository at this point in the history
fs/fstest: CreateFile should use sync
  • Loading branch information
kzys committed Jun 16, 2023
2 parents 25762ef + 3fa7d7a commit ce02f71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/fstest/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ func writeFileStream(name string, stream func() io.Reader, perm os.FileMode) App
return err
}
defer func() {
err := f.Close()
err := f.Sync()
if err != nil && retErr == nil {
retErr = err
}

err = f.Close()
if err != nil && retErr == nil {
retErr = err
}
Expand Down

0 comments on commit ce02f71

Please sign in to comment.