Update multithread.go

This commit is contained in:
alingse 2025-04-04 20:22:12 +08:00 committed by GitHub
parent 1c106b45ad
commit 193e0011b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -312,9 +312,9 @@ func (w *writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, r
// if we were buffering, flush to disk
switch w := writer.(type) {
case *bufio.Writer:
er2 := w.Flush()
if er2 != nil {
return -1, fmt.Errorf("multi-thread copy: flush failed: %w", er2)
err := w.Flush()
if err != nil {
return -1, fmt.Errorf("multi-thread copy: flush failed: %w", err)
}
}
return n, nil