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
Hide 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
import
(
"bytes"
"fmt"
"reflect"
"strings"
)
...
...
@@ -33,21 +33,16 @@ var (
//
// [*] other than == and !=, which use reflect.DeepEqual.
type
FilterValueCompare
struct
{
Op
Op
Value
interface
{}
TypedFilter
Filter
Op
Op
Value
[]
byte
}
func
(
f
FilterValueCompare
)
Filter
(
e
Entry
)
bool
{
if
f
.
TypedFilter
!=
nil
{
return
f
.
TypedFilter
.
Filter
(
e
)
}
switch
f
.
Op
{
case
Equal
:
return
reflect
.
Deep
Equal
(
f
.
Value
,
e
.
Value
)
return
bytes
.
Equal
(
f
.
Value
,
e
.
Value
)
case
NotEqual
:
return
!
reflect
.
Deep
Equal
(
f
.
Value
,
e
.
Value
)
return
!
bytes
.
Equal
(
f
.
Value
,
e
.
Value
)
default
:
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