String concatenation can be simplified GO-R4003
Anti-pattern
Major
8 months agoa year old
suggestion: rootPath + "/" + endpoint.KeyspaceGroupIDPath(groupID)
 863		Keyspaces: keyspaces,
 864	}
 865
 866	key := strings.Join([]string{rootPath, endpoint.KeyspaceGroupIDPath(groupID)}, "/") 867	value, err := json.Marshal(group)
 868	if err != nil {
 869		return err
suggestion: rootPath + "/" + endpoint.KeyspaceGroupIDPath(id)
 834	ctx context.Context, etcdClient *clientv3.Client,
 835	rootPath string, id uint32,
 836) error {
 837	key := strings.Join([]string{rootPath, endpoint.KeyspaceGroupIDPath(id)}, "/") 838
 839	if _, err := etcdClient.Delete(ctx, key); err != nil {
 840		return err
suggestion: rootPath + "/" + endpoint.KeyspaceGroupIDPath(group.ID)
 816	ctx context.Context, etcdClient *clientv3.Client,
 817	rootPath string, group *endpoint.KeyspaceGroup,
 818) error {
 819	key := strings.Join([]string{rootPath, endpoint.KeyspaceGroupIDPath(group.ID)}, "/") 820	value, err := json.Marshal(group)
 821	if err != nil {
 822		return err
suggestion: KeyspaceGroupIDPrefix() + "/" + (\d{5})$
289
290// GetCompiledKeyspaceGroupIDRegexp returns the compiled regular expression for matching keyspace group id.
291func GetCompiledKeyspaceGroupIDRegexp() *regexp.Regexp {
292	pattern := strings.Join([]string{KeyspaceGroupIDPrefix(), `(\d{5})$`}, "/")293	return regexp.MustCompile(pattern)
294}
295
suggestion: s.rootPath + "/" + startKey
237}
238
239func (s *GrpcServer) loadRangeFromETCD(startKey, endKey string) ([]string, []string, int64, error) {
240	startKey = strings.Join([]string{s.rootPath, startKey}, "/")241	var opOption []clientv3.OpOption
242	if endKey == "\ " {
243		opOption = append(opOption, clientv3.WithPrefix())