code: func (p *UnitStatePublisher) updateCache(update *unit.UnitStateHeartbeat) (changed bool) {
  	p.cacheMutex.Lock()
  	defer p.cacheMutex.Unlock()
  
  	last, ok := p.cache[update.Name]
  	p.cache[update.Name] = update.State
  
  	if !ok || !reflect.DeepEqual(last, update.State) {
  		changed = true
  	}
  	return
  }
docs: // updateCache updates the cache of UnitStates which the UnitStatePublisher
  // uses to determine when a change has occurred, and to do a periodic
  // publishing of all UnitStates. It returns a boolean indicating whether the
  // state in the given UnitStateHeartbeat differs from the state from the
  // previous heartbeat of this unit, if any exists.