Repository: etcd-io/etcd
File: server/features/etcd_features.go (Go)

Code before:
	// main PR: https://github.com/etcd-io/etcd/pull/17661
	SetMemberLocalAddr featuregate.Feature = "SetMemberLocalAddr"
)

var (
	DefaultEtcdServerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
		DistributedTracing:           {Default: false, PreRelease: featuregate.Alpha},
		StopGRPCServiceOnDefrag:      {Default: false, PreRelease: featuregate.Alpha},
		InitialCorruptCheck:          {Default: false, PreRelease: featuregate.Alpha},
		CompactHashCheck:             {Default: false, PreRelease: featuregate.Alpha},
		TxnModeWriteWithSharedBuffer: {Default: true, PreRelease: featuregate.Beta},
		LeaseCheckpoint:              {Default: false, PreRelease: featuregate.Alpha},
		LeaseCheckpointPersist:       {Default: false, PreRelease: featuregate.Alpha},
		SetMemberLocalAddr:           {Default: false, PreRelease: featuregate.Alpha},
	}
	// ExperimentalFlagToFeatureMap is the map from the cmd line flags of experimental features
	// to their corresponding feature gates.
	// Deprecated: Only add existing experimental features here. DO NOT use for new features.
	ExperimentalFlagToFeatureMap = map[string]featuregate.Feature{
		"experimental-stop-grpc-service-on-defrag":       StopGRPCServiceOnDefrag,
		"experimental-initial-corrupt-check":             InitialCorruptCheck,
		"experimental-compact-hash-check-enabled":        CompactHashCheck,
		"experimental-txn-mode-write-with-shared-buffer": TxnModeWriteWithSharedBuffer,
		"experimental-enable-lease-checkpoint":           LeaseCheckpoint,
		"experimental-enable-lease-checkpoint-persist":   LeaseCheckpointPersist,
		"experimental-enable-set-member-localaddr":       SetMemberLocalAddr,
	}
)

func NewDefaultServerFeatureGate(name string, lg *zap.Logger) featuregate.FeatureGate {
	fg := featuregate.New(fmt.Sprintf("%sServerFeatureGate", name), lg)
	if err := fg.Add(DefaultEtcdServerFeatureGates); err != nil {
		panic(err)
	}
	return fg
}


Review comment (suggestion):
It's added in main only previously, we don't need to backward compatible with anything, so let's just remove it
```suggestion
```

Code after:
	SetMemberLocalAddr featuregate.Feature = "SetMemberLocalAddr"
)

var (
	DefaultEtcdServerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
		DistributedTracing:           {Default: false, PreRelease: featuregate.Alpha},
		StopGRPCServiceOnDefrag:      {Default: false, PreRelease: featuregate.Alpha},
		InitialCorruptCheck:          {Default: false, PreRelease: featuregate.Alpha},
		CompactHashCheck:             {Default: false, PreRelease: featuregate.Alpha},
		TxnModeWriteWithSharedBuffer: {Default: true, PreRelease: featuregate.Beta},
		LeaseCheckpoint:              {Default: false, PreRelease: featuregate.Alpha},
		LeaseCheckpointPersist:       {Default: false, PreRelease: featuregate.Alpha},
		SetMemberLocalAddr:           {Default: false, PreRelease: featuregate.Alpha},
	}
	// ExperimentalFlagToFeatureMap is the map from the cmd line flags of experimental features
	// to their corresponding feature gates.
	// Deprecated: Only add existing experimental features here. DO NOT use for new features.
	ExperimentalFlagToFeatureMap = map[string]featuregate.Feature{
		"experimental-stop-grpc-service-on-defrag":       StopGRPCServiceOnDefrag,
		"experimental-initial-corrupt-check":             InitialCorruptCheck,
		"experimental-compact-hash-check-enabled":        CompactHashCheck,
		"experimental-txn-mode-write-with-shared-buffer": TxnModeWriteWithSharedBuffer,
		"experimental-enable-lease-checkpoint":           LeaseCheckpoint,
		"experimental-enable-lease-checkpoint-persist":   LeaseCheckpointPersist,
	}
)

func NewDefaultServerFeatureGate(name string, lg *zap.Logger) featuregate.FeatureGate {
	fg := featuregate.New(fmt.Sprintf("%sServerFeatureGate", name), lg)
	if err := fg.Add(DefaultEtcdServerFeatureGates); err != nil {
		panic(err)
	}
	return fg
}