replace error creation

This commit is contained in:
Marco Vito Moscaritolo 2024-11-11 14:06:04 +01:00 committed by Mike Farah
parent f168172bf4
commit 6908161f1f

View File

@ -1,7 +1,7 @@
package yqlib
import (
"fmt"
"errors"
)
func errorOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
@ -16,5 +16,5 @@ func errorOperator(d *dataTreeNavigator, context Context, expressionNode *Expres
if rhs.MatchingNodes.Len() > 0 {
errorMessage = rhs.MatchingNodes.Front().Value.(*CandidateNode).Value
}
return Context{}, fmt.Errorf(errorMessage)
return Context{}, errors.New(errorMessage)
}