Skip to content

predicates without quoting strings #28

@flashpixx

Description

@flashpixx

Hello,

I'm using the call predicate.TextContains with that call .Has("lastName", predicate.TextContains("t") and this creates an error, because the passed variable content will not be quoted, I must replace it with .Has("lastName", predicate.TextContains(""t"")` .

In my opinion the definition of the function seems not be correct:

func TextContains(str string) *Predicate {
	s := "textContains(" + str + ")"
	a := Predicate(s)
	return &a
}

The fixed definition of the first function line should be

s := "textContains(\"" + str + "\")"

Other calls can be create similar issues.

Thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions