String concatenation can be simplified GO-R4003
Anti-pattern
Major
3 occurrences in this check
suggestion: leaderPath + "/" + ExpectedPrimary
116	// write a flag to indicate the current primary has exited
117	resp, err := kv.NewSlowLogTxn(client).
118		Then(
119			clientv3.OpPut(strings.Join([]string{leaderPath, ExpectedPrimary}, "/"), string(leaderRaw), clientv3.WithLease(grantResp.ID)),120			// indicate the current primary has exited
121			clientv3.OpDelete(leaderPath)).
122		Commit()
suggestion: leaderPath + "/" + ExpectedPrimary
 92	log.Info("remove expected primary key", zap.String("leader-path", leaderPath))
 93	// remove expected leader key
 94	resp, err := kv.NewSlowLogTxn(client).
 95		Then(clientv3.OpDelete(strings.Join([]string{leaderPath, ExpectedPrimary}, "/"))). 96		Commit()
 97	if err != nil || !resp.Succeeded {
 98		log.Error("change expected primary error", errs.ZapError(err))
suggestion: leaderPath + "/" + ExpectedPrimary
 76
 77// GetExpectedPrimary indicates API has changed the primary, ONLY SET VALUE BY API.
 78func GetExpectedPrimary(client *clientv3.Client, leaderPath string) string {
 79	primary, err := etcdutil.GetValue(client, strings.Join([]string{leaderPath, ExpectedPrimary}, "/")) 80	if err != nil {
 81		log.Error("get expected primary key error", errs.ZapError(err))
 82		return ""