From 2129573f6de09887658fc8c5b05937c8310655da Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 18 Jul 2022 16:36:02 -0700 Subject: [PATCH] "utf8s" -> "utf8" --- README.md | 10 +++++----- doc.go | 12 ++++++------ errors.go | 2 +- format.go | 4 ++-- format_test.go | 2 +- invalidutf8.go | 2 +- len.go | 10 +++++----- len_test.go | 2 +- nilreader.go | 2 +- nilwriter.go | 2 +- readrune.go | 2 +- readrune_test.go | 2 +- runeerror.go | 2 +- runereader.go | 4 ++-- runereader_test.go | 2 +- runescanner.go | 4 ++-- runescanner_test.go | 2 +- runewriter.go | 2 +- runewriter_test.go | 6 +++--- writerune.go | 2 +- writerune_test.go | 2 +- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 2cee964..643d3be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-utf8 -Package **utf8s** provides tools for working with Unicode encoded as UTF-8, for the Go programming language. +Package **utf8** provides tools for working with Unicode encoded as UTF-8, for the Go programming language. ## Documention @@ -17,7 +17,7 @@ var reader io.Reader // ... -r, n, err := utf8s.ReadRune(reader) +r, n, err := utf8.ReadRune(reader) ``` ```go @@ -29,7 +29,7 @@ var r rune // ... -n, err := utf8s.WriteRune(w, r) +n, err := utf8.WriteRune(w, r) ``` ```go @@ -37,7 +37,7 @@ var reader io.Reader // ... -runeReader := utf8s.NewRuneReader(reader) +runeReader := utf8.NewRuneReader(reader) // ... @@ -49,7 +49,7 @@ var reader io.Reader // ... -runeScanner := utf8s.NewRuneScanner(reader) +runeScanner := utf8.NewRuneScanner(reader) // ... diff --git a/doc.go b/doc.go index 5b52b7f..754495a 100644 --- a/doc.go +++ b/doc.go @@ -1,5 +1,5 @@ /* -Package utf8s provides tools for working with Unicode encoded as UTF-8. +Package utf8 provides tools for working with Unicode encoded as UTF-8. Example @@ -8,7 +8,7 @@ Example // ... - r, n, err := utf8s.ReadRune(reader) + r, n, err := utf8.ReadRune(reader) Example @@ -21,7 +21,7 @@ Example // ... - n, err := utf8s.WriteRune(w, r) + n, err := utf8.WriteRune(w, r) Example @@ -30,7 +30,7 @@ Example // ... - runeReader := utf8s.NewRuneReader(reader) + runeReader := utf8.NewRuneReader(reader) // .. @@ -43,7 +43,7 @@ Example // ... - runeScanner := utf8s.NewRuneScanner(reader) + runeScanner := utf8.NewRuneScanner(reader) // ... @@ -120,4 +120,4 @@ This is done as described in the following table: └────────────┴───────────────────────┴────────────────┴──────────────────┴──────────┴──────────┴──────────┴──────────┘ */ -package utf8s +package utf8 diff --git a/errors.go b/errors.go index 4cad8d5..3fbd284 100644 --- a/errors.go +++ b/errors.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "errors" diff --git a/format.go b/format.go index b5b896a..b248a19 100644 --- a/format.go +++ b/format.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "bytes" @@ -8,7 +8,7 @@ import ( // // Example // -// utf8s.FormatBinary('۵') +// utf8.FormatBinary('۵') // // // Outputs: // // <<0b11011011 ; 0b10110101>> diff --git a/format_test.go b/format_test.go index 717bf8b..b1b9567 100644 --- a/format_test.go +++ b/format_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "testing" diff --git a/invalidutf8.go b/invalidutf8.go index e6100f6..61fcc27 100644 --- a/invalidutf8.go +++ b/invalidutf8.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 type InvalidUTF8Complainer interface { error diff --git a/len.go b/len.go index e1e68e1..fed97be 100644 --- a/len.go +++ b/len.go @@ -1,28 +1,28 @@ -package utf8s +package utf8 // Len returns the number of bytes in a UTF-8 encoding of this Unicode code point. // // Example // -// length := utf8s.Len('A') +// length := utf8.Len('A') // // // length == 1 // // Example // -// length := utf8s.Len('r') +// length := utf8.Len('r') // // // length == 1 // // Example // -// length := utf8s.Len('¡') +// length := utf8.Len('¡') // // // length == 2 // // Example // -// length := utf8s.Len('۵') +// length := utf8.Len('۵') // // // length == 2 func Len(r rune) int { diff --git a/len_test.go b/len_test.go index bda27d5..258251d 100644 --- a/len_test.go +++ b/len_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "testing" diff --git a/nilreader.go b/nilreader.go index 4e9cea7..4913291 100644 --- a/nilreader.go +++ b/nilreader.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 type NilReaderComplainer interface { error diff --git a/nilwriter.go b/nilwriter.go index b0780f5..a9ac546 100644 --- a/nilwriter.go +++ b/nilwriter.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 type NilWriterComplainer interface { error diff --git a/readrune.go b/readrune.go index 391f53c..b84462d 100644 --- a/readrune.go +++ b/readrune.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/readrune_test.go b/readrune_test.go index ca41dd1..ac307bc 100644 --- a/readrune_test.go +++ b/readrune_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/runeerror.go b/runeerror.go index 3f4ff54..033c64d 100644 --- a/runeerror.go +++ b/runeerror.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 const ( RuneError = '\uFFFD' // Unicode Replacement Character (U+FFFD). diff --git a/runereader.go b/runereader.go index 9afe93c..43c2e08 100644 --- a/runereader.go +++ b/runereader.go @@ -1,10 +1,10 @@ -package utf8s +package utf8 import ( "io" ) -// A utf8s.RuneReader implements the io.RuneReader interface by reading from an io.Reader. +// A utf8.RuneReader implements the io.RuneReader interface by reading from an io.Reader. type RuneReader struct { reader io.Reader } diff --git a/runereader_test.go b/runereader_test.go index 08b0fc6..28afbae 100644 --- a/runereader_test.go +++ b/runereader_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/runescanner.go b/runescanner.go index 22a19b5..ac08d3c 100644 --- a/runescanner.go +++ b/runescanner.go @@ -1,10 +1,10 @@ -package utf8s +package utf8 import ( "io" ) -// A utf8s.RuneScanner implements the io.RuneScanner interface by reading from an io.Reader. +// A utf8.RuneScanner implements the io.RuneScanner interface by reading from an io.Reader. type RuneScanner struct { reader io.Reader diff --git a/runescanner_test.go b/runescanner_test.go index 4d45d3a..b1d8400 100644 --- a/runescanner_test.go +++ b/runescanner_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/runewriter.go b/runewriter.go index b63b8fa..6807c06 100644 --- a/runewriter.go +++ b/runewriter.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/runewriter_test.go b/runewriter_test.go index ba3eb5f..37103d4 100644 --- a/runewriter_test.go +++ b/runewriter_test.go @@ -1,4 +1,4 @@ -package utf8s_test +package utf8_test import ( "github.com/reiver/go-utf8" @@ -58,7 +58,7 @@ func TestRuneWriter(t *testing.T) { var buffer strings.Builder var total int - runeWriter := utf8s.NewRuneWriter(&buffer) + runeWriter := utf8.NewRuneWriter(&buffer) for runeNumber, r := range test.Runes { @@ -73,7 +73,7 @@ func TestRuneWriter(t *testing.T) { continue TestLoop } - if expected, actual := n, utf8s.Len(r); expected != actual { + if expected, actual := n, utf8.Len(r); expected != actual { t.Errorf("For test #%d and rune #%d, expected a certain number of bytes to be written, but actually wasn't.", testNumber, runeNumber) for i, rr := range test.Runes { t.Logf("\t[%d] %q (%d)", i, string(rr), rr) diff --git a/writerune.go b/writerune.go index 5dbc404..a4e2e06 100644 --- a/writerune.go +++ b/writerune.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "io" diff --git a/writerune_test.go b/writerune_test.go index 4e7b7c3..527b58c 100644 --- a/writerune_test.go +++ b/writerune_test.go @@ -1,4 +1,4 @@ -package utf8s +package utf8 import ( "bytes"