fix(evolution): capture Close() error on write file in appendJSONLRecords
This commit is contained in:
1 parent
cf67dd3851
commit
7d71a4d93f
1 file changed
+5
-1
@@ -88,7 +88,11 @@ func (s *Store) appendJSONLRecords(ctx context.Context, path string, records []L
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
defer func() {
|
||||
if closeErr := f.Close(); closeErr != nil && err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
}()
|
||||
|
||||
enc := json.NewEncoder(f)
|
||||
for _, record := range records {
|
||||
|
||||
Reference in new issue
Block a user