Skip to content

proposal: archive/zip: return io.ReaderAt in "func (f *File) OpenRaw()" #65497

Description

@je4

Proposal Details

The archive/zip library allows uncompressed files to be saved in a zip file. This allows, for example, another zip file to be stored uncompressed in a zip file. When reading the file, it is now possible to open this ZIP file via File.OpenRaw(). However, as only the type io.Reader is returned here, it cannot be opened with zip.NewReader(). Internally, File.OpenRaw() already uses the ReaderAt type so that the returned io.Reader can be casted to io.ReaderAt. However, as this is not sustainable, it would be better if io.ReaderAt could be returned directly.

Example: https://go.dev/play/p/DlP3vqHtHY3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions