1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00
Files
incus/internal/io/readseeker.go
Denys Mosiiuk f0c4438e70 incus/io: #2636 fix linter complaints in internal/io
Changes:

  - Added missing docstrings.
  - Renamed `min` function parameter to `minimum`.

Signed-off-by: Denys Mosiiuk <dmos@dector.space>
2025-12-15 23:32:15 +01:00

26 lines
560 B
Go

package io
import (
"io"
)
type readSeeker struct {
io.Reader
io.Seeker
}
// NewReadSeeker combines provided io.Reader and io.Seeker into a new io.ReadSeeker.
func NewReadSeeker(reader io.Reader, seeker io.Seeker) io.ReadSeeker {
return &readSeeker{Reader: reader, Seeker: seeker}
}
// Read reads data from the reader.
func (r *readSeeker) Read(p []byte) (n int, err error) {
return r.Reader.Read(p)
}
// Seek seeks to the specified offset.
func (r *readSeeker) Seek(offset int64, whence int) (int64, error) {
return r.Seeker.Seek(offset, whence)
}