mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 16:41:34 +02:00
lib/readers: factor ErrorReader from multiple sources
This commit is contained in:
11
lib/readers/error.go
Normal file
11
lib/readers/error.go
Normal file
@ -0,0 +1,11 @@
|
||||
package readers
|
||||
|
||||
// ErrorReader wraps an error to return on Read
|
||||
type ErrorReader struct {
|
||||
Err error
|
||||
}
|
||||
|
||||
// Read always returns the error
|
||||
func (er ErrorReader) Read(p []byte) (n int, err error) {
|
||||
return 0, er.Err
|
||||
}
|
Reference in New Issue
Block a user