From b73d918d27959e28b6d1ab0ae2ffcc0bb3bcc863 Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Tue, 24 Sep 2024 23:48:12 +0700 Subject: [PATCH] fix lint errors --- connector/internal/collection.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/connector/internal/collection.go b/connector/internal/collection.go index 9f9894d..39c8779 100644 --- a/connector/internal/collection.go +++ b/connector/internal/collection.go @@ -2,7 +2,6 @@ package internal import ( "context" - "encoding/json" "fmt" "strings" @@ -382,35 +381,6 @@ func (qce *QueryCollectionExecutor) evalValueComparisonCondition(operator *schem return fmt.Sprintf(" %s %f", op, *v), nil } -func (qce *QueryCollectionExecutor) evalStringCondition(name string, operator string, value any) (string, bool, error) { - strValue, err := utils.DecodeNullableString(value) - if err != nil { - return "", false, err - } - if strValue == nil { - return "", false, nil - } - return fmt.Sprintf(`%s%s"%s"`, name, operator, value), true, nil -} - -func (qce *QueryCollectionExecutor) evalStringSliceCondition(name string, operator string, value any) (string, bool, error) { - var err error - var sliceValue []string - if str, ok := value.(string); ok { - // try to parse the slice from the json string - err = json.Unmarshal([]byte(str), &sliceValue) - } else { - sliceValue, err = utils.DecodeStringSlice(value) - } - if err != nil { - return "", false, err - } - if len(sliceValue) == 0 { - return "", false, nil - } - return fmt.Sprintf(`%s%s"%s"`, name, operator, strings.Join(sliceValue, "|")), true, nil -} - func (qce *QueryCollectionExecutor) getComparisonValue(input schema.ComparisonValue) (any, error) { return getComparisonValue(input, qce.Variables) }