ReadString reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadString returns
(delim byte)
| 397 | // ReadString returns err != nil if and only if the returned data does not end |
| 398 | // in delim. |
| 399 | func (b *Buffer) ReadString(delim byte) (line string, err error) { |
| 400 | slice, err := b.readSlice(delim) |
| 401 | return string(slice), err |
| 402 | } |
| 403 | |
| 404 | // NewBuffer creates and initializes a new Buffer using buf as its initial |
| 405 | // contents. It is intended to prepare a Buffer to read existing data. It |