add Text.WriteByte
This commit is contained in:
parent
317124058e
commit
a05abdca76
|
@ -141,6 +141,11 @@ func (txt *Text) WriteString(s string) (n int, err error) {
|
||||||
return len(s), nil
|
return len(s), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (txt *Text) WriteByte(c byte) error {
|
||||||
|
_, err := txt.WriteRune(rune(c))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (txt *Text) WriteRune(r rune) (n int, err error) {
|
func (txt *Text) WriteRune(r rune) (n int, err error) {
|
||||||
n, err = utf8.RuneLen(r), nil // always returns this
|
n, err = utf8.RuneLen(r), nil // always returns this
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue