code: func (b *Buffer) Truncate(n int) {
  	switch {
  	case n < 0 || n > b.Len():
  		panic("leveldb/util.Buffer: truncation out of range")
  	case n == 0:
  		// Reuse buffer space.
  		b.off = 0
  	}
  	b.buf = b.buf[0 : b.off+n]
  }
docs: // Truncate discards all but the first n unread bytes from the buffer.
  // It panics if n is negative or greater than the length of the buffer.