Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fix staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 16, 2021
1 parent c6841c0 commit 40ae33d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 4 additions & 2 deletions dsindex/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ func (x *indexer) ForEach(ctx context.Context, key string, fn func(key, value st
break
}
ent := r.Entry
decIdx, err := decode(path.Base(path.Dir(ent.Key)))
var decIdx string
decIdx, err = decode(path.Base(path.Dir(ent.Key)))
if err != nil {
err = fmt.Errorf("cannot decode index: %v", err)
break
}
decKey, err := decode(path.Base(ent.Key))
var decKey string
decKey, err = decode(path.Base(ent.Key))
if err != nil {
err = fmt.Errorf("cannot decode key: %v", err)
break
Expand Down
3 changes: 1 addition & 2 deletions dspinner/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
"github.com/ipfs/go-merkledag"
mdag "github.com/ipfs/go-merkledag"
"github.com/ipfs/go-merkledag/dagutils"
"github.com/polydawn/refmt/cbor"
"github.com/polydawn/refmt/obj/atlas"
Expand Down Expand Up @@ -191,7 +190,7 @@ func (p *pinner) Pin(ctx context.Context, node ipld.Node, recurse bool) error {
// temporary unlock to fetch the entire graph
p.lock.Unlock()
// Fetch graph starting at node identified by cid
err = mdag.FetchGraph(ctx, c, p.dserv)
err = merkledag.FetchGraph(ctx, c, p.dserv)
p.lock.Lock()
if err != nil {
return err
Expand Down
4 changes: 1 addition & 3 deletions dspinner/pin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,7 @@ func makeStore() (ds.Datastore, ipld.DAGService) {
if err != nil {
panic(err)
}
var dstore ds.Batching
dstore = &batchWrap{ldstore}

dstore := &batchWrap{ldstore}
bstore := blockstore.NewBlockstore(dstore)
bserv := bs.New(bstore, offline.Exchange(bstore))
dserv := mdag.NewDAGService(bserv)
Expand Down
3 changes: 0 additions & 3 deletions pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import (

cid "github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
)

var log = logging.Logger("pin")

const (
linkRecursive = "recursive"
linkDirect = "direct"
Expand Down

0 comments on commit 40ae33d

Please sign in to comment.