SetText sets the text to the given bytes (makes a copy). Pass nil to initialize an empty buffer.
(text []byte)
| 119 | // SetText sets the text to the given bytes (makes a copy). |
| 120 | // Pass nil to initialize an empty buffer. |
| 121 | func (ls *Lines) SetText(text []byte) { |
| 122 | ls.Lock() |
| 123 | defer ls.Unlock() |
| 124 | |
| 125 | ls.bytesToLines(text) |
| 126 | ls.initFromLineBytes() |
| 127 | } |
| 128 | |
| 129 | // SetTextLines sets linesBytes from given lines of bytes, making a copy |
| 130 | // and removing any trailing \r carriage returns, to standardize. |
no test coverage detected