@@ -137,14 +137,6 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
137137 // allow fallthrough
138138 for _ , outcome := range outcomes {
139139 if outcome .Fail != nil {
140- if outcome .Fail .When == "" {
141- result .IsFail = true
142- result .Message = outcome .Fail .Message
143- result .URI = outcome .Fail .URI
144-
145- return result , nil
146- }
147-
148140 isMatch , err := compareRegex (outcome .Fail .When , foundMatches )
149141 if err != nil {
150142 return result , errors .Wrap (err , "failed to compare regex fail conditional" )
@@ -158,14 +150,6 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
158150 return result , nil
159151 }
160152 } else if outcome .Warn != nil {
161- if outcome .Warn .When == "" {
162- result .IsWarn = true
163- result .Message = outcome .Warn .Message
164- result .URI = outcome .Warn .URI
165-
166- return result , nil
167- }
168-
169153 isMatch , err := compareRegex (outcome .Warn .When , foundMatches )
170154 if err != nil {
171155 return result , errors .Wrap (err , "failed to compare regex warn conditional" )
@@ -179,14 +163,6 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
179163 return result , nil
180164 }
181165 } else if outcome .Pass != nil {
182- if outcome .Pass .When == "" {
183- result .IsPass = true
184- result .Message = outcome .Pass .Message
185- result .URI = outcome .Pass .URI
186-
187- return result , nil
188- }
189-
190166 isMatch , err := compareRegex (outcome .Pass .When , foundMatches )
191167 if err != nil {
192168 return result , errors .Wrap (err , "failed to compare regex pass conditional" )
@@ -206,6 +182,9 @@ func analyzeRegexGroups(pattern string, collected []byte, outcomes []*troublesho
206182}
207183
208184func compareRegex (conditional string , foundMatches map [string ]string ) (bool , error ) {
185+ if conditional == "" {
186+ return true , nil
187+ }
209188 parts := strings .Split (strings .TrimSpace (conditional ), " " )
210189
211190 if len (parts ) != 3 {
0 commit comments