INNER CODE UNIT · Go
func
cshum/imagor · blob.go:218
func (readSeekNopCloser) Close() error { return nil }
// hybridReadSeeker starts on a shared forward-only reader and only opens a
// dedicated seekable clone if a caller actually seeks. This keeps the fanout
// path cheap for read-only consumers while preserving seek support for the
// rare seeking path on already-seekable sources.
type hybridReadSeeker struct {
reader io.ReadCloser
seeker io.ReadSeekCloser
newReadSeeker func() (io.ReadSeekCloser, int64, error)
}
// Read implements the io.Reader interface.
func (h *hybridReadSeeker) Read(p []byte) (n int, err error) {
return h.reader.Read(p)
}
// Seek implements the io.Seeker interface.