From 67c4e2d33af8c3112a8530e0570a2a0caa493261 Mon Sep 17 00:00:00 2001 From: Overbool Date: Tue, 30 Oct 2018 10:06:25 +0800 Subject: [PATCH] commands/files: use cmds.EmitOnce in single value License: MIT Signed-off-by: Overbool --- core/commands/files.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/files.go b/core/commands/files.go index 8344dc931134..b63ad8379dcb 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -451,13 +451,13 @@ Examples: Name: name, }) } - return res.Emit(&filesLsOutput{output}) + return cmds.EmitOnce(res, &filesLsOutput{output}) } listing, err := fsn.List(req.Context) if err != nil { return err } - return res.Emit(&filesLsOutput{listing}) + return cmds.EmitOnce(res, &filesLsOutput{listing}) case *mfs.File: _, name := gopath.Split(path) out := &filesLsOutput{[]mfs.NodeListing{{Name: name}}} @@ -476,7 +476,7 @@ Examples: } out.Entries[0].Hash = nd.Cid().String() } - return res.Emit(out) + return cmds.EmitOnce(res, out) default: return errors.New("unrecognized type") }