DeepClone creates a deep clone of b, copying data such that no bytes are shared with any other Buffers.
()
| 423 | // DeepClone creates a deep clone of b, copying data such that no bytes are |
| 424 | // shared with any other Buffers. |
| 425 | func (b *Buffer) DeepClone() Buffer { |
| 426 | newBuf := Buffer{} |
| 427 | buf := b.Clone() |
| 428 | reader := buf.AsBufferReader() |
| 429 | newBuf.WriteFromReader(&reader, b.size) |
| 430 | return newBuf |
| 431 | } |
| 432 | |
| 433 | // Apply applies the given function across all valid data. |
| 434 | func (b *Buffer) Apply(fn func(*View)) { |
no test coverage detected