[release-10.4.18] Go: Bump to 1.24.2 (#103531)
* Go: Bump to 1.24.2 * CI: Update golangci-lint * feat: update swagger * fix: more lints * fix: lints
This commit is contained in:
@@ -129,8 +129,16 @@ func createMathExpression(referenceVar string, thresholdFunc string, args []floa
|
||||
case ThresholdIsBelow:
|
||||
exp = fmt.Sprintf("${%s} < %f", referenceVar, args[0])
|
||||
case ThresholdIsWithinRange:
|
||||
if len(args) < 2 {
|
||||
// avoid panic
|
||||
return "", fmt.Errorf("incorrect number of arguments: got %d but need 2", len(args))
|
||||
}
|
||||
exp = fmt.Sprintf("${%s} > %f && ${%s} < %f", referenceVar, args[0], referenceVar, args[1])
|
||||
case ThresholdIsOutsideRange:
|
||||
if len(args) < 2 {
|
||||
// avoid panic
|
||||
return "", fmt.Errorf("incorrect number of arguments: got %d but need 2", len(args))
|
||||
}
|
||||
exp = fmt.Sprintf("${%s} < %f || ${%s} > %f", referenceVar, args[0], referenceVar, args[1])
|
||||
default:
|
||||
return "", fmt.Errorf("failed to evaluate threshold expression: no such threshold function %s", thresholdFunc)
|
||||
|
||||
Reference in New Issue
Block a user