Skip to content

Commit

Permalink
chore: slice replace loop
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jul 8, 2023
1 parent 3cadfce commit 5f34fa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pkg/object/consulserviceregistry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ func (c *consulAPIClient) ListAllServiceInstances() ([]*api.CatalogService, erro
return nil, fmt.Errorf("pull catalog service %s failed: %v", serviceName, err)
}

for _, service := range services {
catalogServices = append(catalogServices, service)
}
catalogServices = append(catalogServices, services...)
}

return catalogServices, nil
Expand Down
4 changes: 1 addition & 3 deletions pkg/object/serviceregistry/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ func (s *ServiceInstanceSpec) DeepCopy() *ServiceInstanceSpec {
copy := *s

if s.Tags != nil {
for _, tag := range s.Tags {
copy.Tags = append(copy.Tags, tag)
}
copy.Tags = append(copy.Tags, s.Tags...)
}

return &copy
Expand Down

0 comments on commit 5f34fa6

Please sign in to comment.