Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 67c4e2d

Browse files
committedOct 30, 2018
commands/files: use cmds.EmitOnce in single value
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
1 parent 184b770 commit 67c4e2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎core/commands/files.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,13 @@ Examples:
451451
Name: name,
452452
})
453453
}
454-
return res.Emit(&filesLsOutput{output})
454+
return cmds.EmitOnce(res, &filesLsOutput{output})
455455
}
456456
listing, err := fsn.List(req.Context)
457457
if err != nil {
458458
return err
459459
}
460-
return res.Emit(&filesLsOutput{listing})
460+
return cmds.EmitOnce(res, &filesLsOutput{listing})
461461
case *mfs.File:
462462
_, name := gopath.Split(path)
463463
out := &filesLsOutput{[]mfs.NodeListing{{Name: name}}}
@@ -476,7 +476,7 @@ Examples:
476476
}
477477
out.Entries[0].Hash = nd.Cid().String()
478478
}
479-
return res.Emit(out)
479+
return cmds.EmitOnce(res, out)
480480
default:
481481
return errors.New("unrecognized type")
482482
}

0 commit comments

Comments
 (0)
Please sign in to comment.