Skip to content

Commit

Permalink
Merge pull request ipfs/go-unixfs#95 from ipfs/fix-staticcheck
Browse files Browse the repository at this point in the history
fix staticcheck

This commit was moved from ipfs/go-unixfs@8b879fb
  • Loading branch information
marten-seemann authored Jun 2, 2021
2 parents d7b558d + e320b1c commit 54721cb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions unixfs/hamt/hamt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ func TestRemoveAfterMarshal(t *testing.T) {
}

s, err = NewHamtFromDag(ds, nd)
if err != nil {
t.Fatal(err)
}

ctx := context.Background()

Expand Down Expand Up @@ -334,7 +337,13 @@ func TestSetAfterMarshal(t *testing.T) {
}

nd, err = nds.Node()
if err != nil {
t.Fatal(err)
}
nds, err = NewHamtFromDag(ds, nd)
if err != nil {
t.Fatal(err)
}

links, err := nds.EnumLinks(ctx)
if err != nil {
Expand Down Expand Up @@ -408,7 +417,13 @@ func TestDuplicateAddShard(t *testing.T) {
}

node, err := dir.Node()
if err != nil {
t.Fatal(err)
}
dir, err = NewHamtFromDag(ds, node)
if err != nil {
t.Fatal(err)
}

lnks, err := dir.EnumLinks(ctx)
if err != nil {
Expand Down Expand Up @@ -503,7 +518,13 @@ func TestRemoveElemsAfterMarshal(t *testing.T) {
}

nd, err = nds.Node()
if err != nil {
t.Fatal(err)
}
nds, err = NewHamtFromDag(ds, nd)
if err != nil {
t.Fatal(err)
}

links, err := nds.EnumLinks(ctx)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions unixfs/io/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
mdag "github.com/ipfs/go-merkledag"

format "github.com/ipfs/go-unixfs"
hamt "github.com/ipfs/go-unixfs/hamt"
"github.com/ipfs/go-unixfs/hamt"

cid "github.com/ipfs/go-cid"
"github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
)
Expand Down Expand Up @@ -151,7 +151,7 @@ func NewDirectoryFromNode(dserv ipld.DAGService, node ipld.Node) (Directory, err

func (d *BasicDirectory) computeEstimatedSize() {
d.estimatedSize = 0
d.ForEachLink(nil, func(l *ipld.Link) error {
d.ForEachLink(context.TODO(), func(l *ipld.Link) error {
d.addToEstimatedSize(l.Name, l.Cid)
return nil
})
Expand Down

0 comments on commit 54721cb

Please sign in to comment.