code: func (reg *WatchDataReg) Unregister(keyPrefix string) error {
  	reg.adapter.access.Lock()
  	defer reg.adapter.access.Unlock()
  
  	subs := reg.adapter.subscriptions[reg.ResyncName]
  	// verify if key is registered for change events
  	if subs.ChangeChan == nil {
  		// not an error
  		logrus.DefaultLogger().Infof("key %v not registered for change events", keyPrefix)
  		return nil
  	}
  	if subs.CloseChan == nil {
  		return fmt.Errorf("unable to unregister key %v, close channel in subscription is nil", keyPrefix)
  	}
  
  	for index, prefix := range subs.KeyPrefixes {
  		if prefix == keyPrefix {
  			subs.KeyPrefixes = append(subs.KeyPrefixes[:index], subs.KeyPrefixes[index+1:]...)
  			subs.CloseChan <- keyPrefix
  			logrus.DefaultLogger().WithField("resyncName", reg.ResyncName).Infof("Key %v removed from subscription", keyPrefix)
  			return nil
  		}
  	}
  
  	return fmt.Errorf("key %v to unregister was not found", keyPrefix)
  }
docs: // Unregister stops watching of particular key prefix. Method returns error if key which should be removed
  // does not exist or in case the channel to close goroutine is nil