initial commits
parent
b2932e94f1
commit
2fd5967f49
|
@ -134,15 +134,15 @@ func (receiver *Content) Read(p []byte) (int, error) {
|
|||
return 0, errNilByteSlice
|
||||
}
|
||||
|
||||
if receiver.Closed() {
|
||||
return 0, errClosed
|
||||
}
|
||||
|
||||
var reader io.Reader = receiver.reader
|
||||
if nil == reader {
|
||||
return 0, errInternalError
|
||||
}
|
||||
|
||||
if receiver.Closed() {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
return receiver.reader.Read(p)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package strfs
|
||||
|
||||
import (
|
||||
"github.com/reiver/go-fck"
|
||||
)
|
||||
|
||||
const (
|
||||
errClosed = fck.Error("closed")
|
||||
errInternalError = fck.Error("internal error")
|
||||
errNilByteSlice = fck.Error("nil byte slice")
|
||||
errNilReader = fck.Error("nil reader")
|
||||
errNilReceiver = fck.Error("nil receiver")
|
||||
)
|
Loading…
Reference in New Issue