Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-datastore
Commits
623a7ba3
Commit
623a7ba3
authored
Apr 08, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: values are now always bytes
parent
bce485ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
query/filter.go
query/filter.go
+5
-10
No files found.
query/filter.go
View file @
623a7ba3
package
query
package
query
import
(
import
(
"bytes"
"fmt"
"fmt"
"reflect"
"strings"
"strings"
)
)
...
@@ -34,20 +34,15 @@ var (
...
@@ -34,20 +34,15 @@ var (
// [*] other than == and !=, which use reflect.DeepEqual.
// [*] other than == and !=, which use reflect.DeepEqual.
type
FilterValueCompare
struct
{
type
FilterValueCompare
struct
{
Op
Op
Op
Op
Value
interface
{}
Value
[]
byte
TypedFilter
Filter
}
}
func
(
f
FilterValueCompare
)
Filter
(
e
Entry
)
bool
{
func
(
f
FilterValueCompare
)
Filter
(
e
Entry
)
bool
{
if
f
.
TypedFilter
!=
nil
{
return
f
.
TypedFilter
.
Filter
(
e
)
}
switch
f
.
Op
{
switch
f
.
Op
{
case
Equal
:
case
Equal
:
return
reflect
.
Deep
Equal
(
f
.
Value
,
e
.
Value
)
return
bytes
.
Equal
(
f
.
Value
,
e
.
Value
)
case
NotEqual
:
case
NotEqual
:
return
!
reflect
.
Deep
Equal
(
f
.
Value
,
e
.
Value
)
return
!
bytes
.
Equal
(
f
.
Value
,
e
.
Value
)
default
:
default
:
panic
(
fmt
.
Errorf
(
"cannot apply op '%s' to interface{}."
,
f
.
Op
))
panic
(
fmt
.
Errorf
(
"cannot apply op '%s' to interface{}."
,
f
.
Op
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment