Skip to content

Commit 38a24e6

Browse files
ylink-lfsk8s-publishing-bot
authored andcommitted
chore: residual boolptr and intptr removal
Kubernetes-commit: b070b0a5c5ff3d6e356852c67c8ef325aa750daa
1 parent c04562b commit 38a24e6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pkg/conversion/queryparams/convert_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/conversion/queryparams"
2727
"k8s.io/apimachinery/pkg/runtime/schema"
28+
"k8s.io/utils/ptr"
2829
)
2930

3031
type namedString string
@@ -161,20 +162,20 @@ func TestConvert(t *testing.T) {
161162
},
162163
{
163164
input: &baz{
164-
Ptr: intp(5),
165-
Bptr: boolp(true),
165+
Ptr: ptr.To(5),
166+
Bptr: ptr.To(true),
166167
},
167168
expected: url.Values{"ptr": {"5"}, "bptr": {"true"}},
168169
},
169170
{
170171
input: &baz{
171-
Bptr: boolp(true),
172+
Bptr: ptr.To(true),
172173
},
173174
expected: url.Values{"ptr": {""}, "bptr": {"true"}},
174175
},
175176
{
176177
input: &baz{
177-
Ptr: intp(5),
178+
Ptr: ptr.To(5),
178179
},
179180
expected: url.Values{"ptr": {"5"}},
180181
},
@@ -213,7 +214,3 @@ func TestConvert(t *testing.T) {
213214
validateResult(t, test.input, result, test.expected)
214215
}
215216
}
216-
217-
func intp(n int) *int { return &n }
218-
219-
func boolp(b bool) *bool { return &b }

0 commit comments

Comments
 (0)