type Buffer struct { buf []byte off int lastRead int8 } //go:nosplit func BufferReset(b *bytes.Buffer, p []byte) { buffer := (*Buffer)(unsafe.Pointer(b)) buffer.off = 0 } buffer, Unsafe, byte, off