zeroshade commented on code in PR #1047:
URL: https://github.com/apache/arrow-go/pull/1047#discussion_r3722376622
##########
arrow/ipc/writer.go:
##########
@@ -59,9 +59,20 @@ func (w *streamWriter) WritePayload(p Payload) error {
func (w *streamWriter) Write(p []byte) (int, error) {
n, err := w.w.Write(p)
w.pos += int64(n)
+ if err == nil && n != len(p) {
+ err = io.ErrShortWrite
+ }
return n, err
}
+func writeFull(w io.Writer, p []byte) error {
+ n, err := w.Write(p)
+ if err == nil && n != len(p) {
+ err = io.ErrShortWrite
+ }
Review Comment:
So i was looking at https://pkg.go.dev/io#Writer and saw that Write will
*always* return a non-nil error on a short write, so I don't think we need to
do this at all or add the checks you've added.
--
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]