WriteString appends the contents of s to the buffer, growing the buffer as needed. The return value n is the length of s; err is always nil. If the buffer becomes too large, WriteString will panic with ErrTooLarge.
(s string)
| 185 | // needed. The return value n is the length of s; err is always nil. If the |
| 186 | // buffer becomes too large, WriteString will panic with ErrTooLarge. |
| 187 | func (b *Buffer) WriteString(s string) (n int, err error) { |
| 188 | m := b.grow(len(s)) |
| 189 | return copy(b.buf[m:], s), nil |
| 190 | } |
| 191 | |
| 192 | // MinRead is the minimum slice size passed to a Read call by |
| 193 | // Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond |