utf8.RuneWriter
parent
4b93e7ecf9
commit
1c5ab89cc7
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue