1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-20 00:18:12 +08:00

files2.0: no error from Entries

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2018-11-24 04:51:43 +01:00
parent adc7490755
commit b10e718ab4
11 changed files with 15 additions and 18 deletions

View File

@ -416,10 +416,7 @@ func (adder *Adder) AddAllAndPin(file files.Node) (ipld.Node, error) {
// Iterate over each top-level file and add individually. Otherwise the
// single files.File f is treated as a directory, affecting hidden file
// semantics.
it, err := tf.Entries()
if err != nil {
return nil, err
}
it := tf.Entries()
for it.Next() {
if err := adder.addFile(it.Name(), it.Node()); err != nil {
return nil, err
@ -537,7 +534,7 @@ func (adder *Adder) addDir(path string, dir files.Directory) error {
return err
}
it, _ := dir.Entries()
it := dir.Entries()
for it.Next() {
fpath := gopath.Join(path, it.Name())