Skip to content

NewReadOnly fails on exhausted ReadSeeker #336

@ribasushi

Description

@ribasushi
  • An os.File has GenerateIndex() called on
  • This puts the os.File's underlying Reader at EOF
  • If one then calls NewReadOnly the check here falls through to the io.Reader, sees the EOF and aborts

Observe the workaround at lines 81~83 in the sequence here. A potential fix is to rewind when the argument is a ReadSeeker, before dropping to the Reader part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions