Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan committed Nov 12, 2024
1 parent 1d7be54 commit 4c16f7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/analyze/text_analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ func analyzeRegexPattern(pattern string, collected []byte, outcomes []*troublesh
IconURI: "https://troubleshoot.sh/images/analyzer-icons/text-analyze.svg",
}

isMatch := re.MatchString(string(collected))

for _, outcome := range outcomes {
if outcome.Fail != nil {
isMatch := re.MatchString(string(collected))

// if the outcome.Fail.When is not set, default to false
if outcome.Fail.When == "" {
outcome.Fail.When = "false"
Expand All @@ -141,7 +143,6 @@ func analyzeRegexPattern(pattern string, collected []byte, outcomes []*troublesh
result.URI = outcome.Fail.URI
}
} else if outcome.Warn != nil {
isMatch := re.MatchString(string(collected))
// if the outcome.Warn.When is not set, default to false
if outcome.Warn.When == "" {
outcome.Warn.When = "false"
Expand All @@ -158,7 +159,6 @@ func analyzeRegexPattern(pattern string, collected []byte, outcomes []*troublesh
result.URI = outcome.Warn.URI
}
} else if outcome.Pass != nil {
isMatch := re.MatchString(string(collected))
// if the outcome.Pass.When is not set, default to true
if outcome.Pass.When == "" {
outcome.Pass.When = "true"
Expand Down

0 comments on commit 4c16f7d

Please sign in to comment.