Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Sep 24, 2024
1 parent c585147 commit b73d918
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions connector/internal/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package internal

import (
"context"
"encoding/json"
"fmt"
"strings"

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit b73d918

Please sign in to comment.