zeroshade commented on code in PR #583:
URL: https://github.com/apache/iceberg-go/pull/583#discussion_r2406881849
##########
manifest.go:
##########
@@ -460,12 +460,12 @@ type hasFieldToIDMap interface {
setFieldIDToFixedSizeMap(map[int]int)
}
-func fetchManifestEntries(m ManifestFile, fs iceio.IO, discardDeleted bool)
([]ManifestEntry, error) {
+func fetchManifestEntries(m ManifestFile, fs iceio.IO, discardDeleted bool) (_
[]ManifestEntry, err error) {
f, err := fs.Open(m.FilePath())
if err != nil {
return nil, err
}
- defer f.Close()
+ defer internal.CheckedClose(f, &err)
return ReadManifest(m, f, discardDeleted)
Review Comment:
this won't work the way you intend since we are returning whatever error is
returned by `ReadManifest`. Instead you would do something like this:
```go
func fetchManifestEntries(m ManifestFile, fs iceio.IO, discardDeleted bool)
([]ManifestEntry, error) {
f, err := fs.Open(m.FilePath())
if err != nil {
return nil, err
}
defer internal.CheckedClose(f, &err)
var entries []ManifestEntry
entries, err = ReadManifest(m, f, discardDeleted)
return entries, err
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]