Closed muktihari closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
0af34cf
) to head (90d9661
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
io.WriteSeeker
asio.Writer
since we forgot to early return. Previously, we treat anio.Writer
that implements bothio.WriterAt
andio.WriteSeeker
, such as*os.File
, asio.WriterAt
so users using*os.File
does not affected by this bug. The bug only affectsio.Writer
that only implementio.WriteSeeker
.io.Writer
that implements bothio.WriterAt
andio.WriteSeeker
will be treated asio.WriteSeeker
. We change this to prevent wrong write on aio.Writer
that is not empty (existing file) as we will aways write at offset 0 to update the header while offset 0 might not be our own content. By treating it asio.WriteSeeker
, we can seek relative to EOF so we ensure that we write on our own data. This also enable us to append to existing file to create a chained FIT file.io.Writer
that solely implementsio.WriterAt
must provide an empty writer.