utf8.RuneWriter

master
Charles Iliya Krempeaux 2022-07-18 20:54:16 -07:00
parent 4b93e7ecf9
commit 1c5ab89cc7
2 changed files with 4 additions and 4 deletions

View File

@ -9,9 +9,9 @@ type RuneWriter struct {
writer io.Writer
}
// NewRuneWriter wraps an io.Writer and returns a RuneWriter.
func NewRuneWriter(writer io.Writer) *RuneWriter {
return &RuneWriter{
// RuneWriterWrap wraps an io.Writer and returns a RuneWriter.
func RuneWriterWrap(writer io.Writer) RuneWriter {
return RuneWriter{
writer: writer,
}
}

View File

@ -58,7 +58,7 @@ func TestRuneWriter(t *testing.T) {
var buffer strings.Builder
var total int
runeWriter := utf8.NewRuneWriter(&buffer)
runeWriter := utf8.RuneWriterWrap(&buffer)
for runeNumber, r := range test.Runes {