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:
silverwind
2026-02-24 07:59:27 +01:00
parent c192d65d18
commit 8d702e75e7

View File

@@ -162,7 +162,7 @@ func (e *Evaluator) evalBinaryNode(node *exprparser.BinaryNode) (*EvaluationResu
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 {
case "&&":
if left.IsFalsy() {
@@ -187,7 +187,7 @@ func (e *Evaluator) evalBinaryNodeLeft(node *exprparser.BinaryNode, left *Evalua
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) {