utf8s.RuneReader
parent
5bbcb5d54a
commit
f81ca5284f
|
@ -8,5 +8,6 @@ var (
|
||||||
errInternalError = errors.New("Internal Error")
|
errInternalError = errors.New("Internal Error")
|
||||||
errInvalidUTF8 = internalInvalidUTF8Complainer{}
|
errInvalidUTF8 = internalInvalidUTF8Complainer{}
|
||||||
errNilReader = internalNilReaderComplainer{}
|
errNilReader = internalNilReaderComplainer{}
|
||||||
|
errNilReceiver = errors.New("Nil Receiver")
|
||||||
errNilWriter = internalNilWriterComplainer{}
|
errNilWriter = internalNilWriterComplainer{}
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,6 +16,10 @@ func NewRuneReader(reader io.Reader) *RuneReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *RuneReader) ReadRune() (rune, int, error) {
|
func (receiver *RuneReader) ReadRune() (rune, int, error) {
|
||||||
|
if nil == receiver {
|
||||||
|
return 0, 0, errNilReceiver
|
||||||
|
}
|
||||||
|
|
||||||
reader := receiver.reader
|
reader := receiver.reader
|
||||||
if nil == reader {
|
if nil == reader {
|
||||||
return 0, 0, errNilReader
|
return 0, 0, errNilReader
|
||||||
|
|
Loading…
Reference in New Issue