Closed
Description
embed.openFile
could trivially implement io.ReaderAt
.
Lines 348 to 381 in 15605ca
That's the entire proposal.
Rationale
io.ReaderAt
can be emulated with io.ReadSeeker
, but this doesn't satisfy the goroutine safety of io.ReaderAt
: “Clients of ReadAt can execute parallel ReadAt calls on the same input source.”
This came up twice now on implementing wazero
syscalls, that follow pread
semantics: tetratelabs/wazero#967, and now tetratelabs/wazero#1037.
It got its own mention in that project's design rationale.
It is also of note that io.ReaderAt
is directly called out on the fs.File
documentation: A file may implement io.ReaderAt or io.Seeker as optimizations.