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

fix staticcheck #95

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions 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 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