diff --git a/core/commands/object/diff.go b/core/commands/object/diff.go index 109fd79963c..840e1cb6423 100644 --- a/core/commands/object/diff.go +++ b/core/commands/object/diff.go @@ -94,7 +94,7 @@ Example: } } - return res.Emit(&Changes{out}) + return cmds.EmitOnce(res, &Changes{out}) }, Type: Changes{}, Encoders: cmds.EncoderMap{ diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 4226bf41d3b..0eef518baca 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -148,7 +148,7 @@ multihash. Links: outLinks, } - return res.Emit(out) + return cmds.EmitOnce(res, out) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *Object) error { @@ -252,7 +252,7 @@ Supported values are: } } - return res.Emit(node) + return cmds.EmitOnce(res, node) }, Type: Node{}, Encoders: cmds.EncoderMap{ @@ -318,7 +318,7 @@ var ObjectStatCmd = &cmds.Command{ CumulativeSize: ns.CumulativeSize, } - return res.Emit(oldStat) + return cmds.EmitOnce(res, oldStat) }, Type: ipld.NodeStat{}, Encoders: cmds.EncoderMap{ @@ -419,7 +419,7 @@ And then run: return err } - return res.Emit(&Object{Hash: p.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()}) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *Object) error { @@ -474,7 +474,7 @@ Available templates: return err } - return res.Emit(&Object{Hash: nd.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: nd.Cid().String()}) }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *Object) error { diff --git a/core/commands/object/patch.go b/core/commands/object/patch.go index 60cca92d866..aefc745cde4 100644 --- a/core/commands/object/patch.go +++ b/core/commands/object/patch.go @@ -49,7 +49,7 @@ the limit will not be respected by the network. cmdkit.StringArg("root", true, false, "The hash of the node to modify."), cmdkit.FileArg("data", true, false, "Data to append.").EnableStdin(), }, - Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error { + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env) if err != nil { return err @@ -70,7 +70,7 @@ the limit will not be respected by the network. return err } - return cmds.EmitOnce(re, &Object{Hash: p.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()}) }, Type: &Object{}, Encoders: cmds.EncoderMap{ @@ -117,7 +117,7 @@ Example: return err } - return res.Emit(&Object{Hash: p.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()}) }, Type: Object{}, Encoders: cmds.EncoderMap{ @@ -156,7 +156,7 @@ Remove a Merkle-link from the given object and return the hash of the result. return err } - return res.Emit(&Object{Hash: p.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()}) }, Type: Object{}, Encoders: cmds.EncoderMap{ @@ -220,7 +220,7 @@ to a file containing 'bar', and returns the hash of the new object. return err } - return res.Emit(&Object{Hash: p.Cid().String()}) + return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()}) }, Type: Object{}, Encoders: cmds.EncoderMap{