initial commits

master
Charles Iliya Krempeaux 2022-12-14 03:28:12 -08:00
parent b2932e94f1
commit 2fd5967f49
2 changed files with 17 additions and 4 deletions

View File

@ -134,15 +134,15 @@ func (receiver *Content) Read(p []byte) (int, error) {
return 0, errNilByteSlice return 0, errNilByteSlice
} }
if receiver.Closed() {
return 0, errClosed
}
var reader io.Reader = receiver.reader var reader io.Reader = receiver.reader
if nil == reader { if nil == reader {
return 0, errInternalError return 0, errInternalError
} }
if receiver.Closed() {
return 0, nil
}
return receiver.reader.Read(p) return receiver.reader.Read(p)
} }

13
errors.go 100644
View File

@ -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")
)