code: func (gs *genericStore) setLimits(limits *StoreLimits) error {
  	// Make a copy.
  	gs.limits = limits.Clone()
  	// Build will validate and apply inheritance if no error.
  	if err := gs.limits.Build(); err != nil {
  		return err
  	}
  	// We don't need the PerChannel map and the sublist. So replace
  	// the map with the sublist instead.
  	gs.sublist = util.NewSublist()
  	for key, val := range gs.limits.PerChannel {
  		// val is already a copy of the original limits.PerChannel[key],
  		// so don't need to make a copy again, we own this.
  		gs.sublist.Insert(key, val)
  	}
  	// Get rid of the map now.
  	gs.limits.PerChannel = nil
  	return nil
  }
docs: // setLimits makes a copy of the given StoreLimits,
  // validates the limits and if ok, applies the inheritance.