Explorar o código

fix error handling in buf.Copy

Darien Raymond %!s(int64=7) %!d(string=hai) anos
pai
achega
b3e46f5d07
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      common/buf/copy.go

+ 3 - 1
common/buf/copy.go

@@ -92,7 +92,9 @@ func copyInternal(reader Reader, writer Writer, handler *copyHandler) error {
 				buffer.Release()
 				return werr
 			}
-		} else if err != nil {
+		}
+
+		if err != nil {
 			return err
 		}
 	}