Rename streamResults to streamResult.
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Kevin Atkinson committed
Sep 20, 2018 at 03:20 UTC
54904a76914121a4017ae22d0c2090caf91f8858
3 files changed
+4
-4
core/commands/cid.go
+1
-1
@@ -84,7 +84,7 @@ The optional format string is a printf style format string:
84
return emitCids(req, resp, opts)
85
},
86
PostRun: cmds.PostRunMap{
87
- cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError {
87
+ cmds.CLI: streamResult(func(v interface{}, out io.Writer) nonFatalError {
88
r := v.(*CidFormatRes)
89
if r.ErrorMsg != "" {
90
return nonFatalError(fmt.Sprintf("%s: %s", r.CidStr, r.ErrorMsg))
core/commands/commands.go
+2
-2
@@ -153,10 +153,10 @@ func unwrapOutput(i interface{}) (interface{}, error) {
153
154
type nonFatalError string
155
156
-// streamResults is a helper function to stream results that possibly
156
+// streamResult is a helper function to stream results that possibly
157
// contain non-fatal errors. The helper function is allowed to panic
158
// on internal errors.
159
-func streamResults(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error {
159
+func streamResult(procVal func(interface{}, io.Writer) nonFatalError) func(cmds.Response, cmds.ResponseEmitter) error {
160
return func(res cmds.Response, re cmds.ResponseEmitter) (err error) {
161
defer func() {
162
if r := recover(); r != nil {
core/commands/filestore.go
+1
-1
@@ -72,7 +72,7 @@ The output is:
72
return res.Emit(out)
73
},
74
PostRun: cmds.PostRunMap{
75
- cmds.CLI: streamResults(func(v interface{}, out io.Writer) nonFatalError {
75
+ cmds.CLI: streamResult(func(v interface{}, out io.Writer) nonFatalError {
76
r := v.(*filestore.ListRes)
77
if r.ErrorMsg != "" {
78
return nonFatalError(r.ErrorMsg)