@@ -123,15 +123,15 @@ description: Standalone workflow
123123 }
124124
125125 // Check that both importers are in the list
126- affectedMap := make (map [string ]bool )
126+ affectedMap := make (map [string ]struct {} )
127127 for _ , w := range affected {
128- affectedMap [w ] = true
128+ affectedMap [w ] = struct {}{}
129129 }
130130
131- if ! affectedMap [topWorkflow1 ] {
131+ if _ , ok := affectedMap [topWorkflow1 ]; ! ok {
132132 t .Errorf ("GetAffectedWorkflows() should include %s" , topWorkflow1 )
133133 }
134- if ! affectedMap [topWorkflow2 ] {
134+ if _ , ok := affectedMap [topWorkflow2 ]; ! ok {
135135 t .Errorf ("GetAffectedWorkflows() should include %s" , topWorkflow2 )
136136 }
137137 })
@@ -353,13 +353,13 @@ imports:
353353 }
354354
355355 // Verify all three workflows are in the affected list
356- affectedMap := make (map [string ]bool )
356+ affectedMap := make (map [string ]struct {} )
357357 for _ , w := range affected {
358- affectedMap [w ] = true
358+ affectedMap [w ] = struct {}{}
359359 }
360360
361361 for i , wf := range workflows {
362- if ! affectedMap [wf ] {
362+ if _ , ok := affectedMap [wf ]; ! ok {
363363 t .Errorf ("GetAffectedWorkflows() should include workflow%d.md" , i )
364364 }
365365 }
@@ -662,12 +662,18 @@ imports:
662662 t .Errorf ("GetAffectedWorkflows(C) returned %d workflows, want 3" , len (affected ))
663663 }
664664
665- affectedMap := make (map [string ]bool )
665+ affectedMap := make (map [string ]struct {} )
666666 for _ , w := range affected {
667- affectedMap [w ] = true
667+ affectedMap [w ] = struct {}{}
668668 }
669669
670- if ! affectedMap [top1 ] || ! affectedMap [top2 ] || ! affectedMap [top3 ] {
670+ if _ , ok := affectedMap [top1 ]; ! ok {
671+ t .Errorf ("GetAffectedWorkflows(C) should include top1, top2, and top3" )
672+ }
673+ if _ , ok := affectedMap [top2 ]; ! ok {
674+ t .Errorf ("GetAffectedWorkflows(C) should include top1, top2, and top3" )
675+ }
676+ if _ , ok := affectedMap [top3 ]; ! ok {
671677 t .Errorf ("GetAffectedWorkflows(C) should include top1, top2, and top3" )
672678 }
673679 })
@@ -680,12 +686,18 @@ imports:
680686 t .Errorf ("GetAffectedWorkflows(B) returned %d workflows, want 3" , len (affected ))
681687 }
682688
683- affectedMap := make (map [string ]bool )
689+ affectedMap := make (map [string ]struct {} )
684690 for _ , w := range affected {
685- affectedMap [w ] = true
691+ affectedMap [w ] = struct {}{}
686692 }
687693
688- if ! affectedMap [top1 ] || ! affectedMap [top2 ] || ! affectedMap [top3 ] {
694+ if _ , ok := affectedMap [top1 ]; ! ok {
695+ t .Errorf ("GetAffectedWorkflows(B) should include top1, top2, and top3" )
696+ }
697+ if _ , ok := affectedMap [top2 ]; ! ok {
698+ t .Errorf ("GetAffectedWorkflows(B) should include top1, top2, and top3" )
699+ }
700+ if _ , ok := affectedMap [top3 ]; ! ok {
689701 t .Errorf ("GetAffectedWorkflows(B) should include top1, top2, and top3" )
690702 }
691703 })
@@ -698,16 +710,19 @@ imports:
698710 t .Errorf ("GetAffectedWorkflows(A) returned %d workflows, want 2" , len (affected ))
699711 }
700712
701- affectedMap := make (map [string ]bool )
713+ affectedMap := make (map [string ]struct {} )
702714 for _ , w := range affected {
703- affectedMap [w ] = true
715+ affectedMap [w ] = struct {}{}
704716 }
705717
706- if ! affectedMap [top1 ] || ! affectedMap [top2 ] {
718+ if _ , ok := affectedMap [top1 ]; ! ok {
719+ t .Errorf ("GetAffectedWorkflows(A) should include top1 and top2" )
720+ }
721+ if _ , ok := affectedMap [top2 ]; ! ok {
707722 t .Errorf ("GetAffectedWorkflows(A) should include top1 and top2" )
708723 }
709724
710- if affectedMap [top3 ] {
725+ if _ , ok := affectedMap [top3 ]; ok {
711726 t .Errorf ("GetAffectedWorkflows(A) should NOT include top3" )
712727 }
713728 })
0 commit comments