From a95dfdcf822ebe8f5373bd357d65fa903d4ce924 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Wed, 12 Nov 2014 00:06:05 -0800 Subject: [PATCH] fix(2/pin) optionvalue signature --- core/commands2/pin.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/commands2/pin.go b/core/commands2/pin.go index 84e8c3749..3ea467b42 100644 --- a/core/commands2/pin.go +++ b/core/commands2/pin.go @@ -34,7 +34,13 @@ on disk. n := req.Context().Node // set recursive flag - recursive, _ := req.Option("recursive").Bool() // false if cast fails. + recursive, found, err := req.Option("recursive").Bool() + if err != nil { + return nil, err + } + if !found { + recursive = false + } paths, err := internal.CastToStrings(req.Arguments()) if err != nil { @@ -67,7 +73,13 @@ collected if needed. n := req.Context().Node // set recursive flag - recursive, _ := req.Option("recursive").Bool() // false if cast fails. + recursive, found, err := req.Option("recursive").Bool() + if err != nil { + return nil, err + } + if !found { + recursive = false // default + } paths, err := internal.CastToStrings(req.Arguments()) if err != nil {