From 3ea19ad2ed5dc2754c5acbae65720404a59e1aeb Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sat, 15 Jun 2024 17:06:17 +1000 Subject: [PATCH] clean code --- pkg/yqlib/operator_unique.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/yqlib/operator_unique.go b/pkg/yqlib/operator_unique.go index b7e78587..7c7ff6b8 100644 --- a/pkg/yqlib/operator_unique.go +++ b/pkg/yqlib/operator_unique.go @@ -59,18 +59,15 @@ func uniqueBy(d *dataTreeNavigator, context Context, expressionNode *ExpressionN func getUniqueKeyValue(rhs Context) (string, error) { keyValue := "null" + var err error if rhs.MatchingNodes.Len() > 0 { first := rhs.MatchingNodes.Front() keyCandidate := first.Value.(*CandidateNode) keyValue = keyCandidate.Value if keyCandidate.Kind != ScalarNode { - var err error keyValue, err = encodeToString(keyCandidate, encoderPreferences{YamlFormat, 0}) - if err != nil { - return "", err - } } } - return keyValue, nil + return keyValue, err }