Parcourir la source

fix error handling in buf.Copy

Darien Raymond il y a 7 ans
Parent
commit
b3e46f5d07
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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
 		}
 	}