Skip to content

Commit 7c42fb5

Browse files
committed
(chore) fix "make reviewable test" lint errors
1 parent 8e4f3e1 commit 7c42fb5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apis/cluster/object/v1alpha1/conversion.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ func (src *Object) ConvertTo(dstRaw conversion.Hub) error {
4040
},
4141
}
4242

43-
connectionDetails := []v1alpha2.ConnectionDetail{}
43+
connectionDetails := make([]v1alpha2.ConnectionDetail, 0, len(src.Spec.ConnectionDetails))
4444
for _, cd := range src.Spec.ConnectionDetails {
4545
connectionDetails = append(connectionDetails, v1alpha2.ConnectionDetail{
4646
ObjectReference: cd.ObjectReference,
4747
ToConnectionSecretKey: cd.ToConnectionSecretKey,
4848
})
4949
}
5050

51-
references := []v1alpha2.Reference{}
51+
references := make([]v1alpha2.Reference, 0, len(src.Spec.References))
5252
for _, r := range src.Spec.References {
5353
ref := v1alpha2.Reference{}
5454
if r.DependsOn != nil {
@@ -120,15 +120,15 @@ func (dst *Object) ConvertFrom(srcRaw conversion.Hub) error { //nolint:gocyclo /
120120
},
121121
}
122122

123-
connectionDetails := []ConnectionDetail{}
123+
connectionDetails := make([]ConnectionDetail, 0, len(src.Spec.ConnectionDetails))
124124
for _, cd := range src.Spec.ConnectionDetails {
125125
connectionDetails = append(connectionDetails, ConnectionDetail{
126126
ObjectReference: cd.ObjectReference,
127127
ToConnectionSecretKey: cd.ToConnectionSecretKey,
128128
})
129129
}
130130

131-
references := []Reference{}
131+
references := make([]Reference, 0, len(src.Spec.References))
132132
for _, r := range src.Spec.References {
133133
ref := Reference{}
134134
if r.DependsOn != nil {

pkg/kube/client/ssa/cache/extractor/gvk_parser_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestParserCacheManager(t *testing.T) {
112112
if diff := cmp.Diff(len(cache.store), len(test.testClusterTargets[pc.GetUID()].gvs)); diff != "" {
113113
t.Fatalf("cache length: -want length, +got length\n: %v", diff)
114114
}
115-
var cacheKeys []schema.GroupVersion
115+
cacheKeys := make([]schema.GroupVersion, 0, len(cache.store))
116116
for k := range cache.store {
117117
cacheKeys = append(cacheKeys, k)
118118
}

0 commit comments

Comments
 (0)