code: func (f *featureGate) SetFromMap(m map[string]bool) error {
  	f.lock.Lock()
  	defer f.lock.Unlock()
  
  	// Copy existing state
  	known := map[Feature]FeatureSpec{}
  	for k, v := range f.known.Load().(map[Feature]FeatureSpec) {
  		known[k] = v
  	}
  	enabled := map[Feature]bool{}
  	for k, v := range f.enabled.Load().(map[Feature]bool) {
  		enabled[k] = v
  	}
  
  	for k, v := range m {
  		k := Feature(k)
  		featureSpec, ok := known[k]
  		if !ok {
  			return fmt.Errorf("unrecognized feature gate: %s", k)
  		}
  		if featureSpec.LockToDefault && featureSpec.Default != v {
  			return fmt.Errorf("cannot set feature gate %v to %v, feature is locked to %v", k, v, featureSpec.Default)
  		}
  		enabled[k] = v
  		// Handle "special" features like "all alpha gates"
  		if fn, found := f.special[k]; found {
  			fn(known, enabled, v)
  		}
  
  		if featureSpec.PreRelease == Deprecated {
  			klog.Warningf("Setting deprecated feature gate %s=%t. It will be removed in a future release.", k, v)
  		} else if featureSpec.PreRelease == GA {
  			klog.Warningf("Setting GA feature gate %s=%t. It will be removed in a future release.", k, v)
  		}
  	}
  
  	// Persist changes
  	f.known.Store(known)
  	f.enabled.Store(enabled)
  
  	klog.V(1).Infof("feature gates: %v", f.enabled)
  	return nil
  }
docs: // SetFromMap stores flag gates for known features from a map[string]bool or returns an error