Skip to content

Commit

Permalink
Update rules.go
Browse files Browse the repository at this point in the history
Reorder common case first
  • Loading branch information
trishankatdatadog authored Feb 23, 2024
1 parent 855cb4b commit 10cdf59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions verifier/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ func applyAttributeRules(env *cel.Env, input interpreter.Activation, rules []Con
case bool:
if !result {
var message string
if r.Debug != "" {
message = fmt.Sprintf("%s\nin rule '%s'", r.Debug, r.Rule)
} else {
if r.Debug == "" {
message = fmt.Sprintf("verification failed for rule '%s'", r.Rule)

} else {
message = fmt.Sprintf("%s\nin rule '%s'", r.Debug, r.Rule)
}

if !r.Warn {
Expand Down

0 comments on commit 10cdf59

Please sign in to comment.