yq/yq-go1_24-replace_error_creation.diff
Jean-Philippe Pialasse f857693cdc * Thu Feb 13 2025 Jean-Philippe Pialasse <jpp@koozali.org> 4.43.1-6.sme
- first SME 11 import
- update spec to build in koji
- add bash completion
- build debugsource
2025-02-13 02:07:32 -05:00

30 lines
946 B
Diff

From 6908161f1fb6713db8259909c606109770fe7673 Mon Sep 17 00:00:00 2001
From: Marco Vito Moscaritolo <mavimo@gmail.com>
Date: Mon, 11 Nov 2024 14:06:04 +0100
Subject: [PATCH] replace error creation
---
pkg/yqlib/operator_error.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/yqlib/operator_error.go b/pkg/yqlib/operator_error.go
index 1a2283de87..d6a2b67fed 100644
--- a/pkg/yqlib/operator_error.go
+++ b/pkg/yqlib/operator_error.go
@@ -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)
}