Write writes data to the buffer.
(p []byte)
| 25 | |
| 26 | // Write writes data to the buffer. |
| 27 | func (b *buffer) Write(p []byte) (n int, err error) { |
| 28 | b.append(p...) |
| 29 | return len(p), nil |
| 30 | } |
| 31 | |
| 32 | // String returns the contents of the buffer as a string. |
| 33 | func (b *buffer) String() string { |