Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.