Skip to content

Commit

Permalink
chore: Use literal syntax to declare zero-length arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
dlipovetsky authored and dkoshkin committed Jun 27, 2023
1 parent 2fb42e4 commit f25fb62
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (r *ClusterResourceSetReconciler) getClustersByClusterResourceSetSelector(c
return nil, errors.Wrap(err, "failed to list clusters")
}

clusters := make([]*clusterv1.Cluster, 0)
clusters := []*clusterv1.Cluster{}
for i := range clusterList.Items {
c := &clusterList.Items[i]
if c.DeletionTimestamp.IsZero() {
Expand Down Expand Up @@ -417,7 +417,7 @@ func (r *ClusterResourceSetReconciler) ensureResourceOwnerRef(ctx context.Contex

// clusterToClusterResourceSet is mapper function that maps clusters to ClusterResourceSet.
func (r *ClusterResourceSetReconciler) clusterToClusterResourceSet(o client.Object) []ctrl.Request {
result := make([]ctrl.Request, 0)
result := []ctrl.Request{}

cluster, ok := o.(*clusterv1.Cluster)
if !ok {
Expand Down Expand Up @@ -455,7 +455,7 @@ func (r *ClusterResourceSetReconciler) clusterToClusterResourceSet(o client.Obje

// resourceToClusterResourceSet is mapper function that maps resources to ClusterResourceSet.
func (r *ClusterResourceSetReconciler) resourceToClusterResourceSet(o client.Object) []ctrl.Request {
result := make([]ctrl.Request, 0)
result := []ctrl.Request{}

// Add all ClusterResourceSet owners.
for _, owner := range o.GetOwnerReferences() {
Expand Down

0 comments on commit f25fb62

Please sign in to comment.