@@ -21,12 +21,14 @@ func (m *mockGetters) HasCurrentRelease(_ context.Context, _ *oapi.ReleaseTarget
2121 return m .hasRelease , m .err
2222}
2323
24+ //go:fix inline
2425func boolPtr (b bool ) * bool {
25- return & b
26+ return new ( b )
2627}
2728
29+ //go:fix inline
2830func stringPtr (s string ) * string {
29- return & s
31+ return new ( s )
3032}
3133
3234func newTestScope () (context.Context , evaluator.EvaluatorScope ) {
@@ -134,7 +136,7 @@ func TestDeploymentWindowEvaluator_AllowWindow_InsideWindow(t *testing.T) {
134136 DeploymentWindow : & oapi.DeploymentWindowRule {
135137 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
136138 DurationMinutes : 60 ,
137- AllowWindow : boolPtr (true ),
139+ AllowWindow : new (true ),
138140 },
139141 }
140142
@@ -179,7 +181,7 @@ func TestDeploymentWindowEvaluator_DenyWindow_InsideWindow(t *testing.T) {
179181 DeploymentWindow : & oapi.DeploymentWindowRule {
180182 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
181183 DurationMinutes : 60 ,
182- AllowWindow : boolPtr (false ),
184+ AllowWindow : new (false ),
183185 },
184186 }
185187
@@ -204,7 +206,7 @@ func TestDeploymentWindowEvaluator_DenyWindow_OutsideWindow(t *testing.T) {
204206 DeploymentWindow : & oapi.DeploymentWindowRule {
205207 Rrule : "FREQ=YEARLY;COUNT=1;DTSTART=20200101T000000Z" ,
206208 DurationMinutes : 1 ,
207- AllowWindow : boolPtr (false ),
209+ AllowWindow : new (false ),
208210 },
209211 }
210212
@@ -228,7 +230,7 @@ func TestDeploymentWindowEvaluator_IgnoresWindowWithoutDeployedVersion(t *testin
228230 DeploymentWindow : & oapi.DeploymentWindowRule {
229231 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
230232 DurationMinutes : 60 ,
231- AllowWindow : boolPtr (false ),
233+ AllowWindow : new (false ),
232234 },
233235 }
234236
@@ -251,7 +253,7 @@ func TestDeploymentWindowEvaluator_NextEvaluationTime(t *testing.T) {
251253 DeploymentWindow : & oapi.DeploymentWindowRule {
252254 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
253255 DurationMinutes : 60 ,
254- AllowWindow : boolPtr (true ),
256+ AllowWindow : new (true ),
255257 },
256258 }
257259
@@ -273,7 +275,7 @@ func TestDeploymentWindowEvaluator_ResultDetails(t *testing.T) {
273275 DeploymentWindow : & oapi.DeploymentWindowRule {
274276 Rrule : rruleStr ,
275277 DurationMinutes : 60 ,
276- AllowWindow : boolPtr (true ),
278+ AllowWindow : new (true ),
277279 },
278280 }
279281
@@ -297,8 +299,8 @@ func TestDeploymentWindowEvaluator_Timezone(t *testing.T) {
297299 DeploymentWindow : & oapi.DeploymentWindowRule {
298300 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
299301 DurationMinutes : 60 ,
300- Timezone : stringPtr ("America/New_York" ),
301- AllowWindow : boolPtr (true ),
302+ Timezone : new ("America / New_York "),
303+ AllowWindow : new (true ),
302304 },
303305 }
304306
@@ -310,8 +312,8 @@ func TestDeploymentWindowEvaluator_Timezone(t *testing.T) {
310312 DeploymentWindow : & oapi.DeploymentWindowRule {
311313 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
312314 DurationMinutes : 60 ,
313- Timezone : stringPtr ("Invalid/Timezone" ),
314- AllowWindow : boolPtr (true ),
315+ Timezone : new ("Invalid / Timezone "),
316+ AllowWindow : new (true ),
315317 },
316318 }
317319
@@ -344,8 +346,8 @@ func TestDeploymentWindowEvaluator_Timezone_VariousTimezones(t *testing.T) {
344346 DeploymentWindow : & oapi.DeploymentWindowRule {
345347 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
346348 DurationMinutes : 60 ,
347- Timezone : stringPtr (tz ),
348- AllowWindow : boolPtr (true ),
349+ Timezone : new (tz ),
350+ AllowWindow : new (true ),
349351 },
350352 }
351353
@@ -368,7 +370,7 @@ func TestDeploymentWindowEvaluator_Timezone_NilTimezone(t *testing.T) {
368370 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
369371 DurationMinutes : 60 ,
370372 Timezone : nil ,
371- AllowWindow : boolPtr (true ),
373+ AllowWindow : new (true ),
372374 },
373375 }
374376
@@ -389,8 +391,8 @@ func TestDeploymentWindowEvaluator_Timezone_EmptyString(t *testing.T) {
389391 DeploymentWindow : & oapi.DeploymentWindowRule {
390392 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
391393 DurationMinutes : 60 ,
392- Timezone : stringPtr ("" ),
393- AllowWindow : boolPtr (true ),
394+ Timezone : new (""),
395+ AllowWindow : new (true ),
394396 },
395397 }
396398
@@ -423,8 +425,8 @@ func TestDeploymentWindowEvaluator_Timezone_InvalidTimezones(t *testing.T) {
423425 DeploymentWindow : & oapi.DeploymentWindowRule {
424426 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
425427 DurationMinutes : 60 ,
426- Timezone : stringPtr (tz ),
427- AllowWindow : boolPtr (true ),
428+ Timezone : new (tz ),
429+ AllowWindow : new (true ),
428430 },
429431 }
430432
@@ -458,8 +460,8 @@ func TestDeploymentWindowEvaluator_Timezone_USBusinessHours(t *testing.T) {
458460 DeploymentWindow : & oapi.DeploymentWindowRule {
459461 Rrule : "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=9;BYMINUTE=0;BYSECOND=0" ,
460462 DurationMinutes : 480 ,
461- Timezone : stringPtr (tc .timezone ),
462- AllowWindow : boolPtr (true ),
463+ Timezone : new (tc.timezone ),
464+ AllowWindow : new (true ),
463465 },
464466 }
465467
@@ -494,8 +496,8 @@ func TestDeploymentWindowEvaluator_Timezone_EuropeanBusinessHours(t *testing.T)
494496 DeploymentWindow : & oapi.DeploymentWindowRule {
495497 Rrule : "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=9;BYMINUTE=0;BYSECOND=0" ,
496498 DurationMinutes : 540 ,
497- Timezone : stringPtr (tc .timezone ),
498- AllowWindow : boolPtr (true ),
499+ Timezone : new (tc.timezone ),
500+ AllowWindow : new (true ),
499501 },
500502 }
501503
@@ -529,8 +531,8 @@ func TestDeploymentWindowEvaluator_Timezone_AsiaPacificBusinessHours(t *testing.
529531 DeploymentWindow : & oapi.DeploymentWindowRule {
530532 Rrule : "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=9;BYMINUTE=0;BYSECOND=0" ,
531533 DurationMinutes : 480 ,
532- Timezone : stringPtr (tc .timezone ),
533- AllowWindow : boolPtr (true ),
534+ Timezone : new (tc.timezone ),
535+ AllowWindow : new (true ),
534536 },
535537 }
536538
@@ -565,8 +567,8 @@ func TestDeploymentWindowEvaluator_Timezone_MaintenanceWindowWithTimezone(t *tes
565567 DeploymentWindow : & oapi.DeploymentWindowRule {
566568 Rrule : "FREQ=WEEKLY;BYDAY=SU;BYHOUR=2;BYMINUTE=0;BYSECOND=0" ,
567569 DurationMinutes : 240 ,
568- Timezone : stringPtr (tc .timezone ),
569- AllowWindow : boolPtr (false ),
570+ Timezone : new (tc.timezone ),
571+ AllowWindow : new (false ),
570572 },
571573 }
572574
@@ -599,8 +601,8 @@ func TestDeploymentWindowEvaluator_Timezone_DSTAwareTimezones(t *testing.T) {
599601 DeploymentWindow : & oapi.DeploymentWindowRule {
600602 Rrule : "FREQ=DAILY;BYHOUR=12;BYMINUTE=0;BYSECOND=0" ,
601603 DurationMinutes : 60 ,
602- Timezone : stringPtr (tz ),
603- AllowWindow : boolPtr (true ),
604+ Timezone : new (tz ),
605+ AllowWindow : new (true ),
604606 },
605607 }
606608
@@ -633,8 +635,8 @@ func TestDeploymentWindowEvaluator_Timezone_NonDSTTimezones(t *testing.T) {
633635 DeploymentWindow : & oapi.DeploymentWindowRule {
634636 Rrule : "FREQ=DAILY;BYHOUR=12;BYMINUTE=0;BYSECOND=0" ,
635637 DurationMinutes : 60 ,
636- Timezone : stringPtr (tz ),
637- AllowWindow : boolPtr (true ),
638+ Timezone : new (tz ),
639+ AllowWindow : new (true ),
638640 },
639641 }
640642
@@ -703,8 +705,8 @@ func TestDeploymentWindowEvaluator_WeeklyBusinessHours(t *testing.T) {
703705 DeploymentWindow : & oapi.DeploymentWindowRule {
704706 Rrule : "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=9;BYMINUTE=0;BYSECOND=0" ,
705707 DurationMinutes : 480 ,
706- Timezone : stringPtr ("America/New_York" ),
707- AllowWindow : boolPtr (true ),
708+ Timezone : new ("America / New_York "),
709+ AllowWindow : new (true ),
708710 },
709711 }
710712
@@ -725,8 +727,8 @@ func TestDeploymentWindowEvaluator_MaintenanceWindow(t *testing.T) {
725727 DeploymentWindow : & oapi.DeploymentWindowRule {
726728 Rrule : "FREQ=WEEKLY;BYDAY=SU;BYHOUR=2;BYMINUTE=0;BYSECOND=0" ,
727729 DurationMinutes : 240 ,
728- Timezone : stringPtr ("UTC" ),
729- AllowWindow : boolPtr (false ),
730+ Timezone : new ("UTC "),
731+ AllowWindow : new (false ),
730732 },
731733 }
732734
@@ -747,7 +749,7 @@ func TestDeploymentWindowEvaluator_ActionRequired(t *testing.T) {
747749 DeploymentWindow : & oapi.DeploymentWindowRule {
748750 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
749751 DurationMinutes : 60 ,
750- AllowWindow : boolPtr (false ),
752+ AllowWindow : new (false ),
751753 },
752754 }
753755
@@ -769,7 +771,7 @@ func TestDeploymentWindowEvaluator_MemoizationWorks(t *testing.T) {
769771 DeploymentWindow : & oapi.DeploymentWindowRule {
770772 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
771773 DurationMinutes : 60 ,
772- AllowWindow : boolPtr (true ),
774+ AllowWindow : new (true ),
773775 },
774776 }
775777
@@ -792,8 +794,8 @@ func TestDeploymentWindowEvaluator_EnhancedMetadata_AllowWindowInside(t *testing
792794 DeploymentWindow : & oapi.DeploymentWindowRule {
793795 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
794796 DurationMinutes : 60 ,
795- Timezone : stringPtr ("America/New_York" ),
796- AllowWindow : boolPtr (true ),
797+ Timezone : new ("America / New_York "),
798+ AllowWindow : new (true ),
797799 },
798800 }
799801
@@ -826,8 +828,8 @@ func TestDeploymentWindowEvaluator_EnhancedMetadata_DenyWindowInside(t *testing.
826828 DeploymentWindow : & oapi.DeploymentWindowRule {
827829 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
828830 DurationMinutes : 60 ,
829- Timezone : stringPtr ("UTC" ),
830- AllowWindow : boolPtr (false ),
831+ Timezone : new ("UTC "),
832+ AllowWindow : new (false ),
831833 },
832834 }
833835
@@ -861,8 +863,8 @@ func TestDeploymentWindowEvaluator_EnhancedMetadata_DenyWindowOutside(t *testing
861863 DeploymentWindow : & oapi.DeploymentWindowRule {
862864 Rrule : "FREQ=YEARLY;COUNT=1;DTSTART=20200101T000000Z" ,
863865 DurationMinutes : 1 ,
864- Timezone : stringPtr ("Europe/London" ),
865- AllowWindow : boolPtr (false ),
866+ Timezone : new ("Europe / London "),
867+ AllowWindow : new (false ),
866868 },
867869 }
868870
@@ -897,7 +899,7 @@ func TestDeploymentWindowEvaluator_DailyBYHOUR_DetectsInsideWindow(t *testing.T)
897899 DeploymentWindow : & oapi.DeploymentWindowRule {
898900 Rrule : rruleStr ,
899901 DurationMinutes : 240 ,
900- AllowWindow : boolPtr (true ),
902+ AllowWindow : new (true ),
901903 },
902904 }
903905
@@ -929,7 +931,7 @@ func TestDeploymentWindowEvaluator_DailyBYHOUR_DenyWindow_DetectsInsideWindow(t
929931 DeploymentWindow : & oapi.DeploymentWindowRule {
930932 Rrule : rruleStr ,
931933 DurationMinutes : 180 ,
932- AllowWindow : boolPtr (false ),
934+ AllowWindow : new (false ),
933935 },
934936 }
935937
@@ -956,7 +958,7 @@ func TestDeploymentWindowEvaluator_TimeRemainingFormat(t *testing.T) {
956958 DeploymentWindow : & oapi.DeploymentWindowRule {
957959 Rrule : "FREQ=MINUTELY;INTERVAL=1" ,
958960 DurationMinutes : 120 ,
959- AllowWindow : boolPtr (true ),
961+ AllowWindow : new (true ),
960962 },
961963 }
962964
0 commit comments