You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2023/07/12 16:39:38 UTC
[GitHub] [arrow] zeroshade commented on a diff in pull request #36646: GH-36645: [Go] returns writer.Close error to caller when writing parquet
zeroshade commented on code in PR #36646:
URL: https://github.com/apache/arrow/pull/36646#discussion_r1261444537
##########
go/parquet/file/file_writer.go:
##########
@@ -165,7 +166,9 @@ func (fw *Writer) Close() error {
fw.rowGroupWriter.Close()
}
fw.rowGroupWriter = nil
- defer fw.sink.Close()
+ defer func() {
+ err = errors.Join(err, fw.sink.Close())
Review Comment:
if `err` is already non-nil, you're gonna swallow it here. You should probably check if it is already nil and if it isn't then you should chain the errors together.
to do so you'll need to remove the `var err error` from line 175 so it doesn't shadow the return variable
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org