refactor: ptr.Ptr to ptr.To

Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Jan Larwig
2025-11-16 22:38:59 +01:00
parent 137decb1ec
commit 0eec65e230
18 changed files with 149 additions and 152 deletions
+2 -2
View File
@@ -69,7 +69,7 @@ func TestGoogleGroupOptionsWithoutServiceAccountJSON(t *testing.T) {
func TestGoogleGroupOptionsWithoutAdminEmail(t *testing.T) {
o := testOptions()
o.Providers[0].GoogleConfig.UseApplicationDefaultCredentials = ptr.Ptr(true)
o.Providers[0].GoogleConfig.UseApplicationDefaultCredentials = ptr.To(true)
err := Validate(o)
assert.NotEqual(t, nil, err)
@@ -82,7 +82,7 @@ func TestGoogleGroupOptionsWithoutGroups(t *testing.T) {
o := testOptions()
// Set admin email and application default credentials but no groups - should still require them
o.Providers[0].GoogleConfig.AdminEmail = "admin@example.com"
o.Providers[0].GoogleConfig.UseApplicationDefaultCredentials = ptr.Ptr(true)
o.Providers[0].GoogleConfig.UseApplicationDefaultCredentials = ptr.To(true)
err := Validate(o)
// Should pass validation since google-group is now optional
assert.Equal(t, nil, err)
+5 -5
View File
@@ -26,7 +26,7 @@ var _ = Describe("Upstreams", func() {
validStaticUpstream := options.Upstream{
ID: "validStaticUpstream",
Path: "/validStaticUpstream",
Static: ptr.Ptr(true),
Static: ptr.To(true),
}
validFileUpstream := options.Upstream{
ID: "validFileUpstream",
@@ -145,11 +145,11 @@ var _ = Describe("Upstreams", func() {
ID: "foo",
Path: "/foo",
URI: "ftp://foo",
Static: ptr.Ptr(true),
Static: ptr.To(true),
FlushInterval: &flushInterval,
PassHostHeader: ptr.Ptr(true),
ProxyWebSockets: ptr.Ptr(true),
InsecureSkipTLSVerify: ptr.Ptr(true),
PassHostHeader: ptr.To(true),
ProxyWebSockets: ptr.To(true),
InsecureSkipTLSVerify: ptr.To(true),
},
},
},