code: func (ms *FileMsgStore) setSliceLimits() {
  	// First set slice limits based on slice configuration.
  	ms.slCountLim = ms.fstore.opts.SliceMaxMsgs
  	ms.slSizeLim = uint64(ms.fstore.opts.SliceMaxBytes)
  	ms.slAgeLim = int64(ms.fstore.opts.SliceMaxAge)
  	// Did we configure any of the "dimension"?
  	ms.slHasLimits = ms.slCountLim > 0 || ms.slSizeLim > 0 || ms.slAgeLim > 0
  
  	// If so, we are done. We will use those limits to decide
  	// when to move to a new slice.
  	if ms.slHasLimits {
  		return
  	}
  
  	// Slices limits were not configured. We will set a limit based on channel limits.
  	if ms.limits.MaxMsgs > 0 {
  		limit := ms.limits.MaxMsgs / 4
  		if limit == 0 {
  			limit = 1
  		}
  		ms.slCountLim = limit
  	}
  	if ms.limits.MaxBytes > 0 {
  		limit := uint64(ms.limits.MaxBytes) / 4
  		if limit == 0 {
  			limit = 1
  		}
  		ms.slSizeLim = limit
  	}
  	if ms.limits.MaxAge > 0 {
  		limit := time.Duration(int64(ms.limits.MaxAge) / 4)
  		if limit < time.Second {
  			limit = time.Second
  		}
  		ms.slAgeLim = int64(limit)
  	}
  	// Refresh our view of slices having limits.
  	ms.slHasLimits = ms.slCountLim > 0 || ms.slSizeLim > 0 || ms.slAgeLim > 0
  }
docs: // setSliceLimits sets the limits of a file slice based on options and/or
  // channel limits.