// Add adds features to the featureGate.
513911
func (f *featureGate) Add(features map[Feature]FeatureSpec) error {
	f.lock.Lock()
	defer f.lock.Unlock()

	if f.closed {
		return fmt.Errorf("cannot add a feature gate after adding it to the flag set")
	}

	// Copy existing state
	known := map[Feature]FeatureSpec{}
	for k, v := range f.known.Load().(map[Feature]FeatureSpec) {
		known[k] = v
	}

	for name, spec := range features {
		if existingSpec, found := known[name]; found {
			if existingSpec == spec {
				continue
			}
			return fmt.Errorf("feature gate %q with different spec already exists: %v", name, existingSpec)
		}

		known[name] = spec
	}

	// Persist updated state
	f.known.Store(known)

	return nil
}
145049
func (b *TodoJSONBuilder) Add(infos ...*TodoPropertyInfo) *TodoJSONBuilder {
	for _, info := range infos {
		b._properties[info.fieldName] = info
	}
	return b
}
348746
func (ns *NamedStopwatch) Add(name string) error {
	ns.Lock()
	defer ns.Unlock()

	return ns.add(name)
}
881035
func (b *HogeJSONBuilder) Add(info *HogePropertyInfo) *HogeJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
234623
func (b *InsertBuilder) Add(vals ...interface{}) *InsertBuilder {
	var rows Values
	if b.Insert.Rows != nil {
		rows = b.Insert.Rows.(Values)
	}
	b.Insert.Rows = append(rows, makeValTuple(vals))
	return b
}
1277780
func (g *Mutable) Add(v, w int) {
	g.AddCost(v, w, 0)
}
174294
func AddFeatureGatesStringFlag(fs *pflag.FlagSet, featureGatesString *string) {
	if knownFeatures := features.KnownFeatures(&features.InitFeatureGates); len(knownFeatures) > 0 {
		fs.StringVar(featureGatesString, FeatureGatesString, *featureGatesString, "A set of key=value pairs that describe feature gates for various features. "+
			"Options are:\n"+strings.Join(knownFeatures, "\n"))
	} else {
		fs.StringVar(featureGatesString, FeatureGatesString, *featureGatesString, "A set of key=value pairs that describe feature gates for various features. "+
			"No feature gates are available in this release.")
	}
}
632905
func (b *InnerJSONBuilder) Add(infos ...*InnerPropertyInfo) *InnerJSONBuilder {
	for _, info := range infos {
		b._properties[info.fieldName] = info
	}
	return b
}
1224441
func (t *ObjectTree) Add(o Interface) (val interface{}, isDupe bool) {
	return t.Tree.Add(o)
}
30896
func Add(name string, init func(map[string]string) (volume.VolumeDriver, error)) error {
	return volumeDriverRegistry.Add(name, init)
}
473118
func (fc *FeatureCollection) Append(feature *Feature) *FeatureCollection {
	fc.Features = append(fc.Features, feature)
	return fc
}
1250801
func (s *SyncedSet) Add(datas ...interface{}) {
	s.Lock()
	defer s.Unlock()
	for _, data := range datas {
		s.set[data] = true
	}
}
164923
func (g *Virtual) Add(e EdgeSet) *Virtual {
	return g.union(newEdges(g.Order(), e), true)
}
709014
func (e *Store) Add(id string, Config *Config) {
	e.Lock()
	e.byID[id] = Config
	e.Unlock()
}
720189
func (p *Polygon) Add(point *Point) {
	p.points = append(p.points, point)
}
850911
func (c *changer) Add(v interface{}) error {
	if c.err != nil {
		return c.err
	}
	_, err := c.node.addChild(justValue{v})
	return err
}
1139558
func (c *RolesStore) Add(ctx context.Context, u *chronograf.Role) (*chronograf.Role, error) {
	if err := c.Ctrl.CreateRole(ctx, u.Name); err != nil {
		return nil, err
	}
	if err := c.Ctrl.SetRolePerms(ctx, u.Name, ToEnterprise(u.Permissions)); err != nil {
		return nil, err
	}

	users := make([]string, len(u.Users))
	for i, u := range u.Users {
		users[i] = u.Name
	}
	if err := c.Ctrl.SetRoleUsers(ctx, u.Name, users); err != nil {
		return nil, err
	}
	return u, nil
}