code: func (r *raftLog) deleteRange(min, max uint64) error {
  	var key [8]byte
  	binary.BigEndian.PutUint64(key[:], min)
  	tx, err := r.conn.Begin(true)
  	if err != nil {
  		return err
  	}
  	defer tx.Rollback()
  	curs := tx.Bucket(logsBucket).Cursor()
  	for k, _ := curs.Seek(key[:]); k != nil; k, _ = curs.Next() {
  		// If we reach the max, we are done
  		if binary.BigEndian.Uint64(k) > max {
  			break
  		}
  		if err := curs.Delete(); err != nil {
  			return err
  		}
  	}
  	return tx.Commit()
  }
docs: // Delete logs from the "logs" bucket starting at the min index
  // and up to max index (included).
  // Lock is held on entry