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
aa9190c1
Unverified
Commit
aa9190c1
authored
Apr 19, 2019
by
Steven Allen
Committed by
GitHub
Apr 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #130 from ipfs/fix/basic-keys-only
MapDatastore: obey KeysOnly
parents
9db638c1
2badd367
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
basic_ds.go
basic_ds.go
+5
-1
No files found.
basic_ds.go
View file @
aa9190c1
...
...
@@ -64,7 +64,11 @@ func (d *MapDatastore) Delete(key Key) (err error) {
func
(
d
*
MapDatastore
)
Query
(
q
dsq
.
Query
)
(
dsq
.
Results
,
error
)
{
re
:=
make
([]
dsq
.
Entry
,
0
,
len
(
d
.
values
))
for
k
,
v
:=
range
d
.
values
{
re
=
append
(
re
,
dsq
.
Entry
{
Key
:
k
.
String
(),
Value
:
v
})
e
:=
dsq
.
Entry
{
Key
:
k
.
String
()}
if
!
q
.
KeysOnly
{
e
.
Value
=
v
}
re
=
append
(
re
,
e
)
}
r
:=
dsq
.
ResultsWithEntries
(
q
,
re
)
r
=
dsq
.
NaiveQueryApply
(
q
,
r
)
...
...
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