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-dms3-blockstore
Commits
696689fb
Commit
696689fb
authored
Mar 24, 2017
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: multiple govet warnings
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protonmail.ch
>
parent
985475b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
blockstore.go
blockstore.go
+2
-2
bloom_cache_test.go
bloom_cache_test.go
+6
-2
No files found.
blockstore.go
View file @
696689fb
...
...
@@ -198,14 +198,14 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
return
}
if
e
.
Error
!=
nil
{
log
.
Errorf
(
"blockstore.AllKeysChan got err:"
,
e
.
Error
)
log
.
Errorf
(
"blockstore.AllKeysChan got err:
%s
"
,
e
.
Error
)
return
}
// need to convert to key.Key using key.KeyFromDsKey.
k
,
err
:=
dshelp
.
DsKeyToCid
(
ds
.
RawKey
(
e
.
Key
))
if
err
!=
nil
{
log
.
Warningf
(
"error parsing key from DsKey: "
,
err
)
log
.
Warningf
(
"error parsing key from DsKey:
%s
"
,
err
)
continue
}
...
...
bloom_cache_test.go
View file @
696689fb
...
...
@@ -31,7 +31,9 @@ func testBloomCached(bs Blockstore, ctx context.Context) (*bloomcache, error) {
func
TestPutManyAddsToBloom
(
t
*
testing
.
T
)
{
bs
:=
NewBlockstore
(
syncds
.
MutexWrap
(
ds
.
NewMapDatastore
()))
ctx
,
_
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
defer
cancel
()
cachedbs
,
err
:=
testBloomCached
(
bs
,
ctx
)
select
{
...
...
@@ -75,7 +77,9 @@ func TestHasIsBloomCached(t *testing.T) {
for
i
:=
0
;
i
<
1000
;
i
++
{
bs
.
Put
(
blocks
.
NewBlock
([]
byte
(
fmt
.
Sprintf
(
"data: %d"
,
i
))))
}
ctx
,
_
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
defer
cancel
()
cachedbs
,
err
:=
testBloomCached
(
bs
,
ctx
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
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