Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 34fe1de

Browse files
committedMar 13, 2025
chore: simplify string literals (#3966)
1 parent 7d3ea56 commit 34fe1de

File tree

16 files changed

+42
-42
lines changed

16 files changed

+42
-42
lines changed
 

‎cloud_connector/rule_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestRuleUpdateWithOptionalParams(t *testing.T) {
3333
ID: cloudflare.F("95c365e17e1b46599cd99e5b231fac4e"),
3434
Description: cloudflare.F("Rule description"),
3535
Enabled: cloudflare.F(true),
36-
Expression: cloudflare.F("http.cookie eq \"a=b\""),
36+
Expression: cloudflare.F(`http.cookie eq "a=b"`),
3737
Parameters: cloudflare.F(cloud_connector.RuleUpdateParamsRulesParameters{
3838
Host: cloudflare.F("examplebucket.s3.eu-north-1.amazonaws.com"),
3939
}),

‎content_scanning/payload_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestPayloadNew(t *testing.T) {
3030
_, err := client.ContentScanning.Payloads.New(context.TODO(), content_scanning.PayloadNewParams{
3131
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3232
Body: []content_scanning.PayloadNewParamsBody{{
33-
Payload: cloudflare.F("lookup_json_string(http.request.body.raw, \"file\")"),
33+
Payload: cloudflare.F(`lookup_json_string(http.request.body.raw, "file")`),
3434
}},
3535
})
3636
if err != nil {

‎filters/filter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestFilterNew(t *testing.T) {
3030
)
3131
_, err := client.Filters.New(context.TODO(), filters.FilterNewParams{
3232
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
33-
Expression: cloudflare.F("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155"),
33+
Expression: cloudflare.F(`(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155`),
3434
})
3535
if err != nil {
3636
var apierr *cloudflare.Error

‎firewall/rule_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestRuleNewWithOptionalParams(t *testing.T) {
4141
}),
4242
Filter: cloudflare.F(filters.FirewallFilterParam{
4343
Description: cloudflare.F("Restrict access from these browsers on this address range."),
44-
Expression: cloudflare.F("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155"),
44+
Expression: cloudflare.F(`(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155`),
4545
Paused: cloudflare.F(false),
4646
Ref: cloudflare.F("FIL-100"),
4747
}),
@@ -84,7 +84,7 @@ func TestRuleUpdateWithOptionalParams(t *testing.T) {
8484
}),
8585
Filter: cloudflare.F(filters.FirewallFilterParam{
8686
Description: cloudflare.F("Restrict access from these browsers on this address range."),
87-
Expression: cloudflare.F("(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155"),
87+
Expression: cloudflare.F(`(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155`),
8888
Paused: cloudflare.F(false),
8989
Ref: cloudflare.F("FIL-100"),
9090
}),

‎kv/namespacevalue_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestNamespaceValueUpdateWithOptionalParams(t *testing.T) {
3838
"My-Key",
3939
kv.NamespaceValueUpdateParams{
4040
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
41-
Metadata: cloudflare.F("{\"someMetadataKey\": \"someMetadataValue\"}"),
41+
Metadata: cloudflare.F(`{"someMetadataKey": "someMetadataValue"}`),
4242
Value: cloudflare.F("Some Value"),
4343
Expiration: cloudflare.F(1578435000.000000),
4444
ExpirationTTL: cloudflare.F(300.000000),

‎leaked_credential_checks/detection_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ func TestDetectionNewWithOptionalParams(t *testing.T) {
2929
)
3030
_, err := client.LeakedCredentialChecks.Detections.New(context.TODO(), leaked_credential_checks.DetectionNewParams{
3131
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
32-
Password: cloudflare.F("lookup_json_string(http.request.body.raw, \"secret\")"),
33-
Username: cloudflare.F("lookup_json_string(http.request.body.raw, \"user\")"),
32+
Password: cloudflare.F(`lookup_json_string(http.request.body.raw, "secret")`),
33+
Username: cloudflare.F(`lookup_json_string(http.request.body.raw, "user")`),
3434
})
3535
if err != nil {
3636
var apierr *cloudflare.Error
@@ -59,8 +59,8 @@ func TestDetectionUpdateWithOptionalParams(t *testing.T) {
5959
"18a14bafaa8eb1df04ce683ec18c765e",
6060
leaked_credential_checks.DetectionUpdateParams{
6161
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
62-
Password: cloudflare.F("lookup_json_string(http.request.body.raw, \"secret\")"),
63-
Username: cloudflare.F("lookup_json_string(http.request.body.raw, \"user\")"),
62+
Password: cloudflare.F(`lookup_json_string(http.request.body.raw, "secret")`),
63+
Username: cloudflare.F(`lookup_json_string(http.request.body.raw, "user")`),
6464
},
6565
)
6666
if err != nil {

‎load_balancers/loadbalancer_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestLoadBalancerNewWithOptionalParams(t *testing.T) {
6363
"WNAM": {"de90f38ced07c2e2f4df50b1f61d4194", "9290f38c5d07c2e2f4df57b1f61d4196"},
6464
}),
6565
Rules: cloudflare.F([]load_balancers.RulesParam{{
66-
Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
66+
Condition: cloudflare.F(`http.request.uri.path contains "/testing"`),
6767
Disabled: cloudflare.F(true),
6868
FixedResponse: cloudflare.F(load_balancers.RulesFixedResponseParam{
6969
ContentType: cloudflare.F("application/json"),
@@ -193,7 +193,7 @@ func TestLoadBalancerUpdateWithOptionalParams(t *testing.T) {
193193
"WNAM": {"de90f38ced07c2e2f4df50b1f61d4194", "9290f38c5d07c2e2f4df57b1f61d4196"},
194194
}),
195195
Rules: cloudflare.F([]load_balancers.RulesParam{{
196-
Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
196+
Condition: cloudflare.F(`http.request.uri.path contains "/testing"`),
197197
Disabled: cloudflare.F(true),
198198
FixedResponse: cloudflare.F(load_balancers.RulesFixedResponseParam{
199199
ContentType: cloudflare.F("application/json"),
@@ -377,7 +377,7 @@ func TestLoadBalancerEditWithOptionalParams(t *testing.T) {
377377
"WNAM": {"de90f38ced07c2e2f4df50b1f61d4194", "9290f38c5d07c2e2f4df57b1f61d4196"},
378378
}),
379379
Rules: cloudflare.F([]load_balancers.RulesParam{{
380-
Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
380+
Condition: cloudflare.F(`http.request.uri.path contains "/testing"`),
381381
Disabled: cloudflare.F(true),
382382
FixedResponse: cloudflare.F(load_balancers.RulesFixedResponseParam{
383383
ContentType: cloudflare.F("application/json"),

‎logpush/edge_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestEdgeNewWithOptionalParams(t *testing.T) {
3030
_, err := client.Logpush.Edge.New(context.TODO(), logpush.EdgeNewParams{
3131
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3232
Fields: cloudflare.F("ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID"),
33-
Filter: cloudflare.F("{\"where\":{\"and\":[{\"key\":\"ClientCountry\",\"operator\":\"neq\",\"value\":\"ca\"}]}}"),
33+
Filter: cloudflare.F(`{"where":{"and":[{"key":"ClientCountry","operator":"neq","value":"ca"}]}}`),
3434
Sample: cloudflare.F(int64(1)),
3535
})
3636
if err != nil {

‎page_shield/policy_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestPolicyNew(t *testing.T) {
3333
Action: cloudflare.F(page_shield.PolicyActionAllow),
3434
Description: cloudflare.F("Checkout page CSP policy"),
3535
Enabled: cloudflare.F(true),
36-
Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
36+
Expression: cloudflare.F(`ends_with(http.request.uri.path, "/checkout")`),
3737
Value: cloudflare.F("script-src 'none';"),
3838
},
3939
})
@@ -67,7 +67,7 @@ func TestPolicyUpdateWithOptionalParams(t *testing.T) {
6767
Action: cloudflare.F(page_shield.PolicyUpdateParamsActionAllow),
6868
Description: cloudflare.F("Checkout page CSP policy"),
6969
Enabled: cloudflare.F(true),
70-
Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
70+
Expression: cloudflare.F(`ends_with(http.request.uri.path, "/checkout")`),
7171
Value: cloudflare.F("script-src 'none';"),
7272
},
7373
)

‎rulesets/phase_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ func TestPhaseUpdateWithOptionalParams(t *testing.T) {
4848
Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
4949
Enabled: cloudflare.F(true),
5050
ExposedCredentialCheck: cloudflare.F(rulesets.BlockRuleExposedCredentialCheckParam{
51-
PasswordExpression: cloudflare.F("url_decode(http.request.body.form[\\\"password\\\"][0])"),
52-
UsernameExpression: cloudflare.F("url_decode(http.request.body.form[\\\"username\\\"][0])"),
51+
PasswordExpression: cloudflare.F(`url_decode(http.request.body.form[\"password\"][0])`),
52+
UsernameExpression: cloudflare.F(`url_decode(http.request.body.form[\"username\"][0])`),
5353
}),
5454
Expression: cloudflare.F("ip.src ne 1.1.1.1"),
5555
Logging: cloudflare.F(rulesets.LoggingParam{
@@ -58,7 +58,7 @@ func TestPhaseUpdateWithOptionalParams(t *testing.T) {
5858
Ratelimit: cloudflare.F(rulesets.BlockRuleRatelimitParam{
5959
Characteristics: cloudflare.F([]string{"ip.src"}),
6060
Period: cloudflare.F(rulesets.BlockRuleRatelimitPeriod10),
61-
CountingExpression: cloudflare.F("http.request.body.raw eq \"abcd\""),
61+
CountingExpression: cloudflare.F(`http.request.body.raw eq "abcd"`),
6262
MitigationTimeout: cloudflare.F(int64(600)),
6363
RequestsPerPeriod: cloudflare.F(int64(1000)),
6464
RequestsToOrigin: cloudflare.F(true),

‎rulesets/rule_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ func TestRuleNewWithOptionalParams(t *testing.T) {
4646
Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
4747
Enabled: cloudflare.F(true),
4848
ExposedCredentialCheck: cloudflare.F(rulesets.BlockRuleExposedCredentialCheckParam{
49-
PasswordExpression: cloudflare.F("url_decode(http.request.body.form[\\\"password\\\"][0])"),
50-
UsernameExpression: cloudflare.F("url_decode(http.request.body.form[\\\"username\\\"][0])"),
49+
PasswordExpression: cloudflare.F(`url_decode(http.request.body.form[\"password\"][0])`),
50+
UsernameExpression: cloudflare.F(`url_decode(http.request.body.form[\"username\"][0])`),
5151
}),
5252
Expression: cloudflare.F("ip.src ne 1.1.1.1"),
5353
Logging: cloudflare.F(rulesets.LoggingParam{
@@ -56,7 +56,7 @@ func TestRuleNewWithOptionalParams(t *testing.T) {
5656
Ratelimit: cloudflare.F(rulesets.BlockRuleRatelimitParam{
5757
Characteristics: cloudflare.F([]string{"ip.src"}),
5858
Period: cloudflare.F(rulesets.BlockRuleRatelimitPeriod10),
59-
CountingExpression: cloudflare.F("http.request.body.raw eq \"abcd\""),
59+
CountingExpression: cloudflare.F(`http.request.body.raw eq "abcd"`),
6060
MitigationTimeout: cloudflare.F(int64(600)),
6161
RequestsPerPeriod: cloudflare.F(int64(1000)),
6262
RequestsToOrigin: cloudflare.F(true),
@@ -145,8 +145,8 @@ func TestRuleEditWithOptionalParams(t *testing.T) {
145145
Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
146146
Enabled: cloudflare.F(true),
147147
ExposedCredentialCheck: cloudflare.F(rulesets.BlockRuleExposedCredentialCheckParam{
148-
PasswordExpression: cloudflare.F("url_decode(http.request.body.form[\\\"password\\\"][0])"),
149-
UsernameExpression: cloudflare.F("url_decode(http.request.body.form[\\\"username\\\"][0])"),
148+
PasswordExpression: cloudflare.F(`url_decode(http.request.body.form[\"password\"][0])`),
149+
UsernameExpression: cloudflare.F(`url_decode(http.request.body.form[\"username\"][0])`),
150150
}),
151151
Expression: cloudflare.F("ip.src ne 1.1.1.1"),
152152
Logging: cloudflare.F(rulesets.LoggingParam{
@@ -155,7 +155,7 @@ func TestRuleEditWithOptionalParams(t *testing.T) {
155155
Ratelimit: cloudflare.F(rulesets.BlockRuleRatelimitParam{
156156
Characteristics: cloudflare.F([]string{"ip.src"}),
157157
Period: cloudflare.F(rulesets.BlockRuleRatelimitPeriod10),
158-
CountingExpression: cloudflare.F("http.request.body.raw eq \"abcd\""),
158+
CountingExpression: cloudflare.F(`http.request.body.raw eq "abcd"`),
159159
MitigationTimeout: cloudflare.F(int64(600)),
160160
RequestsPerPeriod: cloudflare.F(int64(1000)),
161161
RequestsToOrigin: cloudflare.F(true),

‎rulesets/ruleset_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ func TestRulesetNewWithOptionalParams(t *testing.T) {
4747
Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
4848
Enabled: cloudflare.F(true),
4949
ExposedCredentialCheck: cloudflare.F(rulesets.BlockRuleExposedCredentialCheckParam{
50-
PasswordExpression: cloudflare.F("url_decode(http.request.body.form[\\\"password\\\"][0])"),
51-
UsernameExpression: cloudflare.F("url_decode(http.request.body.form[\\\"username\\\"][0])"),
50+
PasswordExpression: cloudflare.F(`url_decode(http.request.body.form[\"password\"][0])`),
51+
UsernameExpression: cloudflare.F(`url_decode(http.request.body.form[\"username\"][0])`),
5252
}),
5353
Expression: cloudflare.F("ip.src ne 1.1.1.1"),
5454
Logging: cloudflare.F(rulesets.LoggingParam{
@@ -57,7 +57,7 @@ func TestRulesetNewWithOptionalParams(t *testing.T) {
5757
Ratelimit: cloudflare.F(rulesets.BlockRuleRatelimitParam{
5858
Characteristics: cloudflare.F([]string{"ip.src"}),
5959
Period: cloudflare.F(rulesets.BlockRuleRatelimitPeriod10),
60-
CountingExpression: cloudflare.F("http.request.body.raw eq \"abcd\""),
60+
CountingExpression: cloudflare.F(`http.request.body.raw eq "abcd"`),
6161
MitigationTimeout: cloudflare.F(int64(600)),
6262
RequestsPerPeriod: cloudflare.F(int64(1000)),
6363
RequestsToOrigin: cloudflare.F(true),
@@ -112,8 +112,8 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) {
112112
Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
113113
Enabled: cloudflare.F(true),
114114
ExposedCredentialCheck: cloudflare.F(rulesets.BlockRuleExposedCredentialCheckParam{
115-
PasswordExpression: cloudflare.F("url_decode(http.request.body.form[\\\"password\\\"][0])"),
116-
UsernameExpression: cloudflare.F("url_decode(http.request.body.form[\\\"username\\\"][0])"),
115+
PasswordExpression: cloudflare.F(`url_decode(http.request.body.form[\"password\"][0])`),
116+
UsernameExpression: cloudflare.F(`url_decode(http.request.body.form[\"username\"][0])`),
117117
}),
118118
Expression: cloudflare.F("ip.src ne 1.1.1.1"),
119119
Logging: cloudflare.F(rulesets.LoggingParam{
@@ -122,7 +122,7 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) {
122122
Ratelimit: cloudflare.F(rulesets.BlockRuleRatelimitParam{
123123
Characteristics: cloudflare.F([]string{"ip.src"}),
124124
Period: cloudflare.F(rulesets.BlockRuleRatelimitPeriod10),
125-
CountingExpression: cloudflare.F("http.request.body.raw eq \"abcd\""),
125+
CountingExpression: cloudflare.F(`http.request.body.raw eq "abcd"`),
126126
MitigationTimeout: cloudflare.F(int64(600)),
127127
RequestsPerPeriod: cloudflare.F(int64(1000)),
128128
RequestsToOrigin: cloudflare.F(true),

‎snippets/rule_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestRuleUpdateWithOptionalParams(t *testing.T) {
3232
Rules: cloudflare.F([]snippets.RuleUpdateParamsRule{{
3333
Description: cloudflare.F("Rule description"),
3434
Enabled: cloudflare.F(true),
35-
Expression: cloudflare.F("http.cookie eq \"a=b\""),
35+
Expression: cloudflare.F(`http.cookie eq "a=b"`),
3636
SnippetName: cloudflare.F("snippet_name_01"),
3737
}}),
3838
})

‎zero_trust/accessapplication_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func TestAccessApplicationNewWithOptionalParams(t *testing.T) {
102102
Mappings: cloudflare.F([]zero_trust.SCIMConfigMappingParam{{
103103
Schema: cloudflare.F("urn:ietf:params:scim:schemas:core:2.0:User"),
104104
Enabled: cloudflare.F(true),
105-
Filter: cloudflare.F("title pr or userType eq \"Intern\""),
105+
Filter: cloudflare.F(`title pr or userType eq "Intern"`),
106106
Operations: cloudflare.F(zero_trust.SCIMConfigMappingOperationsParam{
107107
Create: cloudflare.F(true),
108108
Delete: cloudflare.F(true),
@@ -220,7 +220,7 @@ func TestAccessApplicationUpdateWithOptionalParams(t *testing.T) {
220220
Mappings: cloudflare.F([]zero_trust.SCIMConfigMappingParam{{
221221
Schema: cloudflare.F("urn:ietf:params:scim:schemas:core:2.0:User"),
222222
Enabled: cloudflare.F(true),
223-
Filter: cloudflare.F("title pr or userType eq \"Intern\""),
223+
Filter: cloudflare.F(`title pr or userType eq "Intern"`),
224224
Operations: cloudflare.F(zero_trust.SCIMConfigMappingOperationsParam{
225225
Create: cloudflare.F(true),
226226
Delete: cloudflare.F(true),

‎zero_trust/devicepolicycustom_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestDevicePolicyCustomNewWithOptionalParams(t *testing.T) {
3030
)
3131
_, err := client.ZeroTrust.Devices.Policies.Custom.New(context.TODO(), zero_trust.DevicePolicyCustomNewParams{
3232
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
33-
Match: cloudflare.F("user.identity == \"test@cloudflare.com\""),
33+
Match: cloudflare.F(`user.identity == "test@cloudflare.com"`),
3434
Name: cloudflare.F("Allow Developers"),
3535
Precedence: cloudflare.F(100.000000),
3636
AllowModeSwitch: cloudflare.F(true),
@@ -146,7 +146,7 @@ func TestDevicePolicyCustomEditWithOptionalParams(t *testing.T) {
146146
DOHInTunnel: cloudflare.F(true),
147147
Enabled: cloudflare.F(true),
148148
ExcludeOfficeIPs: cloudflare.F(true),
149-
Match: cloudflare.F("user.identity == \"test@cloudflare.com\""),
149+
Match: cloudflare.F(`user.identity == "test@cloudflare.com"`),
150150
Name: cloudflare.F("Allow Developers"),
151151
Precedence: cloudflare.F(100.000000),
152152
RegisterInterfaceIPWithDNS: cloudflare.F(true),

‎zero_trust/gatewayrule_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ func TestGatewayRuleNewWithOptionalParams(t *testing.T) {
3333
Action: cloudflare.F(zero_trust.GatewayRuleNewParamsActionOn),
3434
Name: cloudflare.F("block bad websites"),
3535
Description: cloudflare.F("Block bad websites based on their host name."),
36-
DevicePosture: cloudflare.F("any(device_posture.checks.passed[*] in {\"1308749e-fcfb-4ebc-b051-fe022b632644\"})"),
36+
DevicePosture: cloudflare.F(`any(device_posture.checks.passed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"})`),
3737
Enabled: cloudflare.F(true),
3838
Expiration: cloudflare.F(zero_trust.GatewayRuleNewParamsExpiration{
3939
ExpiresAt: cloudflare.F(time.Now()),
4040
Duration: cloudflare.F(int64(10)),
4141
Expired: cloudflare.F(false),
4242
}),
4343
Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}),
44-
Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"),
44+
Identity: cloudflare.F(`any(identity.groups.name[*] in {"finance"})`),
4545
Precedence: cloudflare.F(int64(0)),
4646
RuleSettings: cloudflare.F(zero_trust.RuleSettingParam{
4747
AddHeaders: cloudflare.F(map[string]string{
@@ -131,7 +131,7 @@ func TestGatewayRuleNewWithOptionalParams(t *testing.T) {
131131
Tue: cloudflare.F("08:00-12:30,13:30-17:00"),
132132
Wed: cloudflare.F("08:00-12:30,13:30-17:00"),
133133
}),
134-
Traffic: cloudflare.F("http.request.uri matches \".*a/partial/uri.*\" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10"),
134+
Traffic: cloudflare.F(`http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10`),
135135
})
136136
if err != nil {
137137
var apierr *cloudflare.Error
@@ -163,15 +163,15 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) {
163163
Action: cloudflare.F(zero_trust.GatewayRuleUpdateParamsActionOn),
164164
Name: cloudflare.F("block bad websites"),
165165
Description: cloudflare.F("Block bad websites based on their host name."),
166-
DevicePosture: cloudflare.F("any(device_posture.checks.passed[*] in {\"1308749e-fcfb-4ebc-b051-fe022b632644\"})"),
166+
DevicePosture: cloudflare.F(`any(device_posture.checks.passed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"})`),
167167
Enabled: cloudflare.F(true),
168168
Expiration: cloudflare.F(zero_trust.GatewayRuleUpdateParamsExpiration{
169169
ExpiresAt: cloudflare.F(time.Now()),
170170
Duration: cloudflare.F(int64(10)),
171171
Expired: cloudflare.F(false),
172172
}),
173173
Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}),
174-
Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"),
174+
Identity: cloudflare.F(`any(identity.groups.name[*] in {"finance"})`),
175175
Precedence: cloudflare.F(int64(0)),
176176
RuleSettings: cloudflare.F(zero_trust.RuleSettingParam{
177177
AddHeaders: cloudflare.F(map[string]string{
@@ -261,7 +261,7 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) {
261261
Tue: cloudflare.F("08:00-12:30,13:30-17:00"),
262262
Wed: cloudflare.F("08:00-12:30,13:30-17:00"),
263263
}),
264-
Traffic: cloudflare.F("http.request.uri matches \".*a/partial/uri.*\" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10"),
264+
Traffic: cloudflare.F(`http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10`),
265265
},
266266
)
267267
if err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.