mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-20 03:46:09 +08:00
Fix evalBinaryNodeLeft returning errors.ErrUnsupported instead of nil
The lint fix in 09d1891 incorrectly changed the default return from
(nil, nil) to (nil, errors.ErrUnsupported) to silence a nilnil lint
warning. This broke all binary expression operations (==, !=, >, <,
&&, ||, etc.) because the caller returns early on any non-nil error.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -162,7 +162,7 @@ func (e *Evaluator) evalBinaryNode(node *exprparser.BinaryNode) (*EvaluationResu
|
|||||||
return e.evalBinaryNodeRight(node, left, right)
|
return e.evalBinaryNodeRight(node, left, right)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Evaluator) evalBinaryNodeLeft(node *exprparser.BinaryNode, left *EvaluationResult) (*EvaluationResult, error) {
|
func (e *Evaluator) evalBinaryNodeLeft(node *exprparser.BinaryNode, left *EvaluationResult) (*EvaluationResult, error) { //nolint:unparam
|
||||||
switch node.Op {
|
switch node.Op {
|
||||||
case "&&":
|
case "&&":
|
||||||
if left.IsFalsy() {
|
if left.IsFalsy() {
|
||||||
@@ -187,7 +187,7 @@ func (e *Evaluator) evalBinaryNodeLeft(node *exprparser.BinaryNode, left *Evalua
|
|||||||
return CreateIntermediateResult(e.Context(), ret), nil
|
return CreateIntermediateResult(e.Context(), ret), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil, errors.ErrUnsupported
|
return nil, nil //nolint:nilnil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Evaluator) evalBinaryNodeRight(node *exprparser.BinaryNode, left *EvaluationResult, right *EvaluationResult) (*EvaluationResult, error) {
|
func (e *Evaluator) evalBinaryNodeRight(node *exprparser.BinaryNode, left *EvaluationResult, right *EvaluationResult) (*EvaluationResult, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user