buffer returns an empty []byte buffer that can be appended to. Any unused portion can be returned later using returnBuffer.
()
| 120 | // buffer returns an empty []byte buffer that can be appended to. Any unused |
| 121 | // portion can be returned later using returnBuffer. |
| 122 | func (s *Scanner) buffer() []byte { |
| 123 | buf := s.bytesPrealloc[:0] |
| 124 | s.bytesPrealloc = nil |
| 125 | return buf |
| 126 | } |
| 127 | |
| 128 | // returnBuffer returns the unused portion of buf to the Scanner, to be used for |
| 129 | // future allocBytes() or buffer() calls. The caller must not use buf again. |
no outgoing calls
no test coverage detected