diff --git a/errors.go b/errors.go index 3fbd284..bfd8dab 100644 --- a/errors.go +++ b/errors.go @@ -6,8 +6,8 @@ import ( var ( errInternalError = errors.New("Internal Error") - errInvalidUTF8 = internalInvalidUTF8Complainer{} - errNilReader = internalNilReaderComplainer{} + errInvalidUTF8 = internalInvalidUTF8Error{} + errNilReader = internalNilReaderError{} errNilReceiver = errors.New("Nil Receiver") - errNilWriter = internalNilWriterComplainer{} + errNilWriter = internalNilWriterError{} ) diff --git a/invalidutf8.go b/invalidutf8.go index b365a22..9a65ded 100644 --- a/invalidutf8.go +++ b/invalidutf8.go @@ -1,6 +1,6 @@ package utf8 -// InvalidUTF8Complainer is a type of error that could be returned +// InvalidUTF8Error is a type of error that could be returned // by the utf8.ReadRune() function, // by the utf8.RuneReader.ReadRune() method, and // by the utf8.RuneScanner.ReadRune() method. @@ -10,23 +10,23 @@ package utf8 // r, n, err := utf8.ReadRune(reader) // if nil != err { // switch { -// case utf8.InvalidUTF8Complainer: +// case utf8.InvalidUTF8Error: // //@TODO // default: // //@TODO // } // } -type InvalidUTF8Complainer interface { +type InvalidUTF8Error interface { error - InvalidUTF8Complainer() + InvalidUTF8Error() } -type internalInvalidUTF8Complainer struct{} +type internalInvalidUTF8Error struct{} -func (complainer internalInvalidUTF8Complainer) Error() string { +func (complainer internalInvalidUTF8Error) Error() string { return "Invalid UTF-8" } -func (complainer internalInvalidUTF8Complainer) InvalidUTF8Complainer() { +func (complainer internalInvalidUTF8Error) InvalidUTF8Error() { // Nothing here. } diff --git a/nilreader.go b/nilreader.go index 4913291..d721a82 100644 --- a/nilreader.go +++ b/nilreader.go @@ -1,16 +1,16 @@ package utf8 -type NilReaderComplainer interface { +type NilReaderError interface { error - NilReaderComplainer() + NilReaderError() } -type internalNilReaderComplainer struct{} +type internalNilReaderError struct{} -func (complainer internalNilReaderComplainer) Error() string { +func (complainer internalNilReaderError) Error() string { return "Nil Reader" } -func (complainer internalNilReaderComplainer) NilReaderComplainer() { +func (complainer internalNilReaderError) NilReaderError() { // Nothing here. } diff --git a/nilwriter.go b/nilwriter.go index a9ac546..111f105 100644 --- a/nilwriter.go +++ b/nilwriter.go @@ -1,16 +1,16 @@ package utf8 -type NilWriterComplainer interface { +type NilWriterError interface { error - NilWriterComplainer() + NilWriterError() } -type internalNilWriterComplainer struct{} +type internalNilWriterError struct{} -func (complainer internalNilWriterComplainer) Error() string { +func (complainer internalNilWriterError) Error() string { return "Nil Writer" } -func (complainer internalNilWriterComplainer) NilWriterComplainer() { +func (complainer internalNilWriterError) NilWriterError() { // Nothing here. } diff --git a/readrune.go b/readrune.go index 6ba6409..1f58187 100644 --- a/readrune.go +++ b/readrune.go @@ -7,7 +7,7 @@ import ( // ReadRune reads a single UTF-8 encoded Unicode character from an io.Reader, // and returns the Unicode character (as a Go rune) and the number of bytes read. // -// If ‘reader’ is nil then ReaderRune will return an error that matches utf8.NilReaderComplainer. +// If ‘reader’ is nil then ReaderRune will return an error that matches utf8.NilReaderError. // // Example // @@ -17,9 +17,9 @@ import ( // if nil != err { // // switch err.(type) { -// case utf8.NilReaderComplainer: +// case utf8.NilReaderError: // //@TODO -// case utf8.InvalidUTF8Complainer: +// case utf8.InvalidUTF8Error: // //@TODO // default: // //TODO diff --git a/writerune.go b/writerune.go index df1b4b4..acf71fc 100644 --- a/writerune.go +++ b/writerune.go @@ -6,7 +6,7 @@ import ( // WriteRune writes a single UTF-8 encoded Unicode character and returns the number of bytes written. // -// If ‘writer’ is nil then WriteRune will return an error that matches utf8.NilWriterComplainer. +// If ‘writer’ is nil then WriteRune will return an error that matches utf8.NilWriterError. // // Example // @@ -16,7 +16,7 @@ import ( // if nil != err { // // switch err.(type) { -// case utf8.NilWriterComplainer: +// case utf8.NilWriterError: // //@TODO // default: // //TODO