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-pinner
Commits
4d125eac
Commit
4d125eac
authored
7 years ago
by
zramsay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply the megacheck tool to improve code quality
License: MIT Signed-off-by:
Zach Ramsay
<
zach.ramsay@gmail.com
>
parent
3abaca0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
gc/gc.go
gc/gc.go
+0
-3
pin.go
pin.go
+1
-3
pin_test.go
pin_test.go
+2
-2
No files found.
gc/gc.go
View file @
4d125eac
...
...
@@ -9,13 +9,10 @@ import (
dag
"github.com/ipfs/go-ipfs/merkledag"
pin
"github.com/ipfs/go-ipfs/pin"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
cid
"gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid"
node
"gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format"
)
var
log
=
logging
.
Logger
(
"gc"
)
// Result represents an incremental output from a garbage collection
// run. It contains either an error, or the cid of a removed object.
type
Result
struct
{
...
...
This diff is collapsed.
Click to expand it.
pin.go
View file @
4d125eac
...
...
@@ -528,9 +528,7 @@ func (p *pinner) InternalPins() []*cid.Cid {
p
.
lock
.
Lock
()
defer
p
.
lock
.
Unlock
()
var
out
[]
*
cid
.
Cid
for
_
,
c
:=
range
p
.
internalPin
.
Keys
()
{
out
=
append
(
out
,
c
)
}
out
=
append
(
out
,
p
.
internalPin
.
Keys
()
...
)
return
out
}
...
...
This diff is collapsed.
Click to expand it.
pin_test.go
View file @
4d125eac
...
...
@@ -183,8 +183,8 @@ func TestIsPinnedLookup(t *testing.T) {
// TODO does pinner need to share datastore with blockservice?
p
:=
NewPinner
(
dstore
,
dserv
,
dserv
)
aNodes
:=
make
([]
*
mdag
.
ProtoNode
,
aBranchLen
,
aBranchLen
)
aKeys
:=
make
([]
*
cid
.
Cid
,
aBranchLen
,
aBranchLen
)
aNodes
:=
make
([]
*
mdag
.
ProtoNode
,
aBranchLen
)
aKeys
:=
make
([]
*
cid
.
Cid
,
aBranchLen
)
for
i
:=
0
;
i
<
aBranchLen
;
i
++
{
a
,
_
:=
randNode
()
if
i
>=
1
{
...
...
This diff is collapsed.
Click to expand it.
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