utf8.RuneWriter
parent
4b93e7ecf9
commit
1c5ab89cc7
|
@ -9,9 +9,9 @@ type RuneWriter struct {
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRuneWriter wraps an io.Writer and returns a RuneWriter.
|
// RuneWriterWrap wraps an io.Writer and returns a RuneWriter.
|
||||||
func NewRuneWriter(writer io.Writer) *RuneWriter {
|
func RuneWriterWrap(writer io.Writer) RuneWriter {
|
||||||
return &RuneWriter{
|
return RuneWriter{
|
||||||
writer: writer,
|
writer: writer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ func TestRuneWriter(t *testing.T) {
|
||||||
var buffer strings.Builder
|
var buffer strings.Builder
|
||||||
var total int
|
var total int
|
||||||
|
|
||||||
runeWriter := utf8.NewRuneWriter(&buffer)
|
runeWriter := utf8.RuneWriterWrap(&buffer)
|
||||||
|
|
||||||
for runeNumber, r := range test.Runes {
|
for runeNumber, r := range test.Runes {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue