code: func (ms *MemoryMsgStore) expireMsgs() {
  	ms.Lock()
  	defer ms.Unlock()
  	if ms.closed {
  		ms.wg.Done()
  		return
  	}
  
  	now := time.Now().UnixNano()
  	maxAge := int64(ms.limits.MaxAge)
  	for {
  		m, ok := ms.msgs[ms.first]
  		if !ok {
  			if ms.first < ms.last {
  				ms.first++
  				continue
  			}
  			ms.ageTimer = nil
  			ms.wg.Done()
  			return
  		}
  		elapsed := now - m.Timestamp
  		if elapsed >= maxAge {
  			ms.removeFirstMsg()
  		} else {
  			if elapsed < 0 {
  				ms.ageTimer.Reset(time.Duration(m.Timestamp - now + maxAge))
  			} else {
  				ms.ageTimer.Reset(time.Duration(maxAge - elapsed))
  			}
  			return
  		}
  	}
  }
docs: // expireMsgs ensures that messages don't stay in the log longer than the
  // limit's MaxAge.