@@ -29,9 +29,8 @@ import (
2929 cid "github.com/ipfs/go-cid"
3030 ipld "github.com/ipfs/go-ipld-format"
3131 dag "github.com/ipfs/go-merkledag"
32- "github.com/spaolacci/murmur3"
33-
3432 format "github.com/ipfs/go-unixfs"
33+ "github.com/spaolacci/murmur3"
3534)
3635
3736const (
@@ -401,10 +400,8 @@ func (ds *Shard) getValue(ctx context.Context, hv *hashBits, key string, cb func
401400func (ds * Shard ) EnumLinks (ctx context.Context ) ([]* ipld.Link , error ) {
402401 var links []* ipld.Link
403402
404- linkResults , err := ds .EnumLinksAsync (ctx )
405- if err != nil {
406- return nil , err
407- }
403+ linkResults := ds .EnumLinksAsync (ctx )
404+
408405 for linkResult := range linkResults {
409406 if linkResult .Err != nil {
410407 return links , linkResult .Err
@@ -426,7 +423,7 @@ func (ds *Shard) ForEachLink(ctx context.Context, f func(*ipld.Link) error) erro
426423
427424// EnumLinksAsync returns a channel which will receive Links in the directory
428425// as they are enumerated, where order is not gauranteed
429- func (ds * Shard ) EnumLinksAsync (ctx context.Context ) ( <- chan format.LinkResult , error ) {
426+ func (ds * Shard ) EnumLinksAsync (ctx context.Context ) <- chan format.LinkResult {
430427 linkResults := make (chan format.LinkResult )
431428 ctx , cancel := context .WithCancel (ctx )
432429 go func () {
@@ -439,7 +436,7 @@ func (ds *Shard) EnumLinksAsync(ctx context.Context) (<-chan format.LinkResult,
439436 emitResult (ctx , linkResults , format.LinkResult {Link : nil , Err : err })
440437 }
441438 }()
442- return linkResults , nil
439+ return linkResults
443440}
444441
445442// makeAsyncTrieGetLinks builds a getLinks function that can be used with EnumerateChildrenAsync
0 commit comments