From d446d585ee0f06febe082128131d7e3c530bbc54 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 7 Jan 2019 20:04:30 -0800 Subject: [PATCH] pin command: rename Error field to Errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commands library interprets the result as an error if it has an Error field. We're working on fixing this by ensuring that errors are either sent as trailers or as the body of a non-200 response. However, we've kept the client-side of the commands library backwards compatible for now. 🦆 License: MIT Signed-off-by: Steven Allen --- core/commands/pin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/pin.go b/core/commands/pin.go index 100c411bd480..5d350c98de36 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -39,8 +39,8 @@ var PinCmd = &cmds.Command{ } type PinOutput struct { - Pins []string - Error map[string]error `json:",omitempty"` + Pins []string + Errors map[string]error `json:",omitempty"` } type AddPinOutput struct { @@ -252,7 +252,7 @@ collected if needed. (By default, recursively. Use -r=false for direct pins.) Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *PinOutput) error { for _, k := range out.Pins { - if err, ok := out.Error[k]; !ok { + if err, ok := out.Errors[k]; !ok { fmt.Fprintf(w, "unpinned %s\n", k) } else { fmt.Fprintf(os.Stderr, "cannot unpin %s: %s\n", k, err)