zeroshade commented on code in PR #1053:
URL: https://github.com/apache/arrow-go/pull/1053#discussion_r3722389282
##########
parquet/file/file_reader.go:
##########
@@ -92,7 +97,18 @@ func OpenParquetFile(filename string, memoryMap bool, opts
...ReadOption) (*Read
return nil, err
}
}
- return NewParquetReader(source, opts...)
+ return newParquetReaderFromFile(source, opts...)
+}
+
+func newParquetReaderFromFile(source readerAtSeekerCloser, opts ...ReadOption)
(*Reader, error) {
+ rdr, err := NewParquetReader(source, opts...)
+ if err != nil {
+ if closeErr := source.Close(); closeErr != nil {
+ return nil, errors.Join(err, closeErr)
+ }
+ return nil, err
Review Comment:
Can't we simplify to this?
```suggestion
return nil, errors.Join(err, source.Close())
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]