mirror of
https://github.com/rclone/rclone.git
synced 2024-12-21 11:06:55 +08:00
23 lines
382 B
Go
23 lines
382 B
Go
package readers
|
|
|
|
import (
|
|
"errors"
|
|
"io"
|
|
)
|
|
|
|
var (
|
|
errCantSeek = errors.New("can't Seek")
|
|
)
|
|
|
|
// NoSeeker adapts an io.Reader into an io.ReadSeeker.
|
|
//
|
|
// However if Seek() is called it will return an error.
|
|
type NoSeeker struct {
|
|
io.Reader
|
|
}
|
|
|
|
// Seek the stream - returns an error
|
|
func (r NoSeeker) Seek(offset int64, whence int) (abs int64, err error) {
|
|
return 0, errCantSeek
|
|
}
|