@@ -121,7 +121,7 @@ func TestScan(t *testing.T) {
121121 }
122122
123123 testScanner := NewScanner ()
124- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {})
124+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {})
125125 assert .NoError (t , err , "scanner encountered an error" )
126126
127127 // Use helper function to either update expected file or compare results
@@ -158,7 +158,7 @@ func TestScan(t *testing.T) {
158158 }
159159
160160 testScanner := NewScanner ()
161- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {
161+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {
162162 IgnoreResultIds : []string {
163163 "efc9a9ee89f1d732c7321067eb701b9656e91f15" ,
164164 "c31705d99e835e4ac7bc3f688bd9558309e056ed" ,
@@ -218,7 +218,7 @@ func TestScan(t *testing.T) {
218218 }
219219
220220 testScanner := NewScanner ()
221- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {
221+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {
222222 IgnoreRules : []string {
223223 "github-pat" ,
224224 },
@@ -271,7 +271,7 @@ func TestScan(t *testing.T) {
271271 errorsCh <- fmt .Errorf ("mock processing error 1" )
272272 errorsCh <- fmt .Errorf ("mock processing error 2" )
273273 }()
274- report , err := testScanner .Scan (scanItems , resources.ScanConfig {}, engine .WithPluginChannels (pluginChannels ))
274+ report , err := testScanner .Scan (scanItems , & resources.ScanConfig {}, engine .WithPluginChannels (pluginChannels ))
275275
276276 assert .Equal (t , 0 , report .GetTotalItemsScanned ())
277277 assert .Equal (t , 0 , report .GetTotalSecretsFound ())
@@ -282,7 +282,7 @@ func TestScan(t *testing.T) {
282282 })
283283 t .Run ("scan with scanItems empty" , func (t * testing.T ) {
284284 testScanner := NewScanner ()
285- actualReport , err := testScanner .Scan ([]ScanItem {}, resources.ScanConfig {})
285+ actualReport , err := testScanner .Scan ([]ScanItem {}, & resources.ScanConfig {})
286286 assert .NoError (t , err , "scanner encountered an error" )
287287 assert .Equal (t , 0 , actualReport .GetTotalItemsScanned ())
288288 assert .Equal (t , 0 , actualReport .GetTotalSecretsFound ())
@@ -291,7 +291,7 @@ func TestScan(t *testing.T) {
291291 })
292292 t .Run ("scan with scanItems nil" , func (t * testing.T ) {
293293 testScanner := NewScanner ()
294- actualReport , err := testScanner .Scan (nil , resources.ScanConfig {})
294+ actualReport , err := testScanner .Scan (nil , & resources.ScanConfig {})
295295 assert .NoError (t , err , "scanner encountered an error" )
296296 assert .Equal (t , 0 , actualReport .GetTotalItemsScanned ())
297297 assert .Equal (t , 0 , actualReport .GetTotalSecretsFound ())
@@ -329,7 +329,7 @@ func TestScan(t *testing.T) {
329329 }
330330
331331 testScanner := NewScanner ()
332- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {})
332+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {})
333333 assert .NoError (t , err , "scanner encountered an error" )
334334
335335 // scan 1
@@ -357,7 +357,7 @@ func TestScan(t *testing.T) {
357357 assert .EqualValues (t , normalizedExpectedReport , normalizedActualReport )
358358
359359 // scan 2
360- actualReport , err = testScanner .Scan (scanItems , resources.ScanConfig {
360+ actualReport , err = testScanner .Scan (scanItems , & resources.ScanConfig {
361361 IgnoreResultIds : []string {
362362 "efc9a9ee89f1d732c7321067eb701b9656e91f15" ,
363363 "c31705d99e835e4ac7bc3f688bd9558309e056ed" ,
@@ -427,14 +427,14 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
427427
428428 tests := []struct {
429429 Name string
430- ScanConfig resources.ScanConfig
430+ ScanConfig * resources.ScanConfig
431431 ScanItems []ScanItem
432432 ExpectedReportPath string
433433 expectErrors []error
434434 }{
435435 {
436436 Name : "Run all default + custom rules" ,
437- ScanConfig : resources.ScanConfig {
437+ ScanConfig : & resources.ScanConfig {
438438 CustomRules : cloneRules (customRules ),
439439 WithValidation : true ,
440440 },
@@ -444,7 +444,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
444444 },
445445 {
446446 Name : "Run only custom rules" ,
447- ScanConfig : resources.ScanConfig {
447+ ScanConfig : & resources.ScanConfig {
448448 CustomRules : cloneRules (customRules ),
449449 WithValidation : true ,
450450 SelectRules : []string {"custom" },
@@ -455,7 +455,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
455455 },
456456 {
457457 Name : "Run only custom override rules" ,
458- ScanConfig : resources.ScanConfig {
458+ ScanConfig : & resources.ScanConfig {
459459 CustomRules : cloneRules (customRules ),
460460 WithValidation : true ,
461461 SelectRules : []string {"override" },
@@ -466,7 +466,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
466466 },
467467 {
468468 Name : "Run default + non override rules" ,
469- ScanConfig : resources.ScanConfig {
469+ ScanConfig : & resources.ScanConfig {
470470 CustomRules : cloneRules (customRules ),
471471 WithValidation : true ,
472472 IgnoreRules : []string {"override" },
@@ -477,7 +477,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
477477 },
478478 {
479479 Name : "Run only custom rules and ignore overrides" ,
480- ScanConfig : resources.ScanConfig {
480+ ScanConfig : & resources.ScanConfig {
481481 CustomRules : cloneRules (customRules ),
482482 WithValidation : true ,
483483 SelectRules : []string {"custom" },
@@ -489,7 +489,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
489489 },
490490 {
491491 Name : "Run only default rules by ignoring custom rules" ,
492- ScanConfig : resources.ScanConfig {
492+ ScanConfig : & resources.ScanConfig {
493493 CustomRules : cloneRules (customRules ),
494494 WithValidation : true ,
495495 IgnoreRules : []string {"custom" },
@@ -500,7 +500,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
500500 },
501501 {
502502 Name : "Run only custom rules by ignoring custom rules by id" ,
503- ScanConfig : resources.ScanConfig {
503+ ScanConfig : & resources.ScanConfig {
504504 CustomRules : cloneRules (customRules ),
505505 WithValidation : true ,
506506 SelectRules : []string {"custom" },
@@ -515,7 +515,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
515515 },
516516 {
517517 Name : "Run only custom rules by ignoring custom rules by name" ,
518- ScanConfig : resources.ScanConfig {
518+ ScanConfig : & resources.ScanConfig {
519519 CustomRules : cloneRules (customRules ),
520520 WithValidation : true ,
521521 SelectRules : []string {"custom" },
@@ -530,7 +530,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
530530 },
531531 {
532532 Name : "Run only custom rules by ignoring override result Ids" ,
533- ScanConfig : resources.ScanConfig {
533+ ScanConfig : & resources.ScanConfig {
534534 CustomRules : cloneRules (customRules ),
535535 WithValidation : true ,
536536 SelectRules : []string {"custom" },
@@ -546,7 +546,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
546546 },
547547 {
548548 Name : "Rule name, id, regex missing" ,
549- ScanConfig : resources.ScanConfig {
549+ ScanConfig : & resources.ScanConfig {
550550 CustomRules : []* ruledefine.Rule {
551551 {
552552 Description : "Match passwords" ,
@@ -568,7 +568,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
568568 },
569569 {
570570 Name : "Regex, severity and score parameters invalid" ,
571- ScanConfig : resources.ScanConfig {
571+ ScanConfig : & resources.ScanConfig {
572572 CustomRules : []* ruledefine.Rule {
573573 {
574574 RuleID : "db18ccf1-4fbf-49f6-aec1-939a2e5464c0" ,
@@ -600,7 +600,7 @@ func TestScanAndScanDynamicWithCustomRules(t *testing.T) {
600600 },
601601 {
602602 Name : "Rule id missing" ,
603- ScanConfig : resources.ScanConfig {
603+ ScanConfig : & resources.ScanConfig {
604604 CustomRules : []* ruledefine.Rule {
605605 {
606606 RuleName : "mock-rule" ,
@@ -699,7 +699,7 @@ func TestScanDynamic(t *testing.T) {
699699 testScanner := NewScanner ()
700700 assert .NoError (t , err , "failed to create scanner" )
701701
702- actualReport , err := testScanner .ScanDynamic (itemsIn , resources.ScanConfig {})
702+ actualReport , err := testScanner .ScanDynamic (itemsIn , & resources.ScanConfig {})
703703 assert .NoError (t , err , "scanner encountered an error" )
704704
705705 compareOrUpdateTestData (t , actualReport , expectedReportPath )
@@ -743,7 +743,7 @@ func TestScanDynamic(t *testing.T) {
743743
744744 testScanner := NewScanner ()
745745
746- actualReport , err := testScanner .ScanDynamic (itemsIn , resources.ScanConfig {
746+ actualReport , err := testScanner .ScanDynamic (itemsIn , & resources.ScanConfig {
747747 IgnoreResultIds : []string {
748748 "efc9a9ee89f1d732c7321067eb701b9656e91f15" ,
749749 "c31705d99e835e4ac7bc3f688bd9558309e056ed" ,
@@ -792,7 +792,7 @@ func TestScanDynamic(t *testing.T) {
792792 testScanner := NewScanner ()
793793 assert .NoError (t , err , "failed to create scanner" )
794794
795- actualReport , err := testScanner .ScanDynamic (itemsIn , resources.ScanConfig {
795+ actualReport , err := testScanner .ScanDynamic (itemsIn , & resources.ScanConfig {
796796 IgnoreRules : []string {
797797 "github-pat" ,
798798 },
@@ -820,7 +820,7 @@ func TestScanDynamic(t *testing.T) {
820820
821821 testScanner := NewScanner ()
822822
823- report , err := testScanner .ScanDynamic (itemsIn , resources.ScanConfig {IgnoreRules : idOfRules })
823+ report , err := testScanner .ScanDynamic (itemsIn , & resources.ScanConfig {IgnoreRules : idOfRules })
824824
825825 assert .Error (t , err )
826826 assert .ErrorIs (t , err , engine .ErrNoRulesSelected )
@@ -870,7 +870,7 @@ func TestScanDynamic(t *testing.T) {
870870 testScanner := NewScanner ()
871871
872872 // scan 2
873- actualReport , err := testScanner .ScanDynamic (itemsIn1 , resources.ScanConfig {})
873+ actualReport , err := testScanner .ScanDynamic (itemsIn1 , & resources.ScanConfig {})
874874 assert .NoError (t , err , "scanner encountered an error" )
875875
876876 expectedReportBytes , err := os .ReadFile (expectedReportPath )
@@ -896,7 +896,7 @@ func TestScanDynamic(t *testing.T) {
896896 assert .EqualValues (t , normalizedExpectedReport , normalizedActualReport )
897897
898898 // scan 2
899- actualReport , err = testScanner .ScanDynamic (itemsIn2 , resources.ScanConfig {
899+ actualReport , err = testScanner .ScanDynamic (itemsIn2 , & resources.ScanConfig {
900900 IgnoreResultIds : []string {
901901 "efc9a9ee89f1d732c7321067eb701b9656e91f15" ,
902902 "c31705d99e835e4ac7bc3f688bd9558309e056ed" ,
@@ -958,7 +958,7 @@ func TestScanWithValidation(t *testing.T) {
958958 }
959959
960960 testScanner := NewScanner ()
961- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {WithValidation : true })
961+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {WithValidation : true })
962962 assert .NoError (t , err , "scanner encountered an error" )
963963
964964 expectedReportBytes , err := os .ReadFile (expectedReportWithValidationPath )
@@ -1109,7 +1109,7 @@ func TestScan_LimitSettings(t *testing.T) {
11091109 }
11101110
11111111 testScanner := NewScanner ()
1112- actualReport , err := testScanner .Scan (scanItems , resources.ScanConfig {
1112+ actualReport , err := testScanner .Scan (scanItems , & resources.ScanConfig {
11131113 MaxFindings : tt .maxFindings ,
11141114 MaxRuleMatchesPerFragment : tt .maxRuleMatchesPerFragment ,
11151115 MaxSecretSize : tt .maxSecretSize ,
@@ -1215,7 +1215,7 @@ func TestScanDynamic_LimitSettings(t *testing.T) {
12151215 close (itemsIn )
12161216
12171217 testScanner := NewScanner ()
1218- actualReport , err := testScanner .ScanDynamic (itemsIn , resources.ScanConfig {
1218+ actualReport , err := testScanner .ScanDynamic (itemsIn , & resources.ScanConfig {
12191219 MaxFindings : tt .maxFindings ,
12201220 MaxRuleMatchesPerFragment : tt .maxRuleMatchesPerFragment ,
12211221 MaxSecretSize : tt .maxSecretSize ,
0 commit comments