valyala / gozstd

go wrapper for zstd
MIT License
420 stars 60 forks source link

Fixed problem with Writer.ReadFrom() #14

Closed stepanbujnak closed 4 years ago

stepanbujnak commented 4 years ago

Previously, Writer.ReadFrom() discarded the bytes that were read when the Read() function of the underlying Reader returned an error. This commit makes sure those bytes are still accounted for.

codecov[bot] commented 4 years ago

Codecov Report

Merging #14 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #14   +/-   ##
=======================================
  Coverage   95.43%   95.43%           
=======================================
  Files           5        5           
  Lines         570      570           
=======================================
  Hits          544      544           
  Misses         15       15           
  Partials       11       11
Impacted Files Coverage Δ
writer.go 87.4% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ba6b039...392bb65. Read the comment docs.

valyala commented 4 years ago

@stepanbujnak , could you add a test covering this corner case in a separate PR?