Commit 4d125eac authored by zramsay's avatar zramsay

apply the megacheck tool to improve code quality

License: MIT
Signed-off-by: default avatarZach Ramsay <zach.ramsay@gmail.com>
parent 3abaca0a
......@@ -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 {
......
......@@ -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
}
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment