append possibly assigns to a wrong variable CRT-D0001
Bug risk
Minor
4 occurrences in this check
append result not assigned to the same slice
1164
1165// Clone returns a cloned PD server config.
1166func (c *PDServerConfig) Clone() *PDServerConfig {
1167	runtimeServices := append(c.RuntimeServices[:0:0], c.RuntimeServices...)1168	cfg := *c
1169	cfg.RuntimeServices = runtimeServices
1170	return &cfg
append result not assigned to the same slice
1013
1014// Clone makes a deep copy of the config.
1015func (c *ReplicationConfig) Clone() *ReplicationConfig {
1016	locationLabels := append(c.LocationLabels[:0:0], c.LocationLabels...)1017	cfg := *c
1018	cfg.LocationLabels = locationLabels
1019	return &cfg
append result not assigned to the same slice
 679
 680// Clone returns a cloned scheduling configuration.
 681func (c *ScheduleConfig) Clone() *ScheduleConfig {
 682	schedulers := append(c.Schedulers[:0:0], c.Schedulers...) 683	var storeLimit map[uint64]StoreLimitConfig
 684	if c.StoreLimit != nil {
 685		storeLimit = make(map[uint64]StoreLimitConfig, len(c.StoreLimit))
append result not assigned to the same slice
 306		// Make a copy to avoid changing DefaultSchedulers unexpectedly.
 307		// When reloading from storage, the config is passed to json.Unmarshal.
 308		// Without clone, the DefaultSchedulers could be overwritten.
 309		*v = append(defValue[:0:0], defValue...) 310	}
 311}
 312