From 6a31056ff64c29c8e8fb853a1c282513a9d80141 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Mon, 24 Aug 2015 17:28:19 +0800 Subject: [PATCH] Change return value for ValidateMountMode 1. rename it from ValidateMountMode to ValidMountMode Because it's a function simply check mount mode is valid or not. 2. remove the rw check return value It's not supposed to be combined into this function, and we already have a function for that check. Signed-off-by: Qiang Huang --- opts/opts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opts/opts.go b/opts/opts.go index 398b8b4f37..28ed604e75 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -202,7 +202,7 @@ func validatePath(val string, validateMountMode bool) (string, error) { containerPath = splited[0] val = path.Clean(containerPath) case 2: - if isValid, _ := volume.ValidateMountMode(splited[1]); validateMountMode && isValid { + if isValid := volume.ValidMountMode(splited[1]); validateMountMode && isValid { containerPath = splited[0] mode = splited[1] val = fmt.Sprintf("%s:%s", path.Clean(containerPath), mode) @@ -213,7 +213,7 @@ func validatePath(val string, validateMountMode bool) (string, error) { case 3: containerPath = splited[1] mode = splited[2] - if isValid, _ := volume.ValidateMountMode(splited[2]); validateMountMode && !isValid { + if isValid := volume.ValidMountMode(splited[2]); validateMountMode && !isValid { return val, fmt.Errorf("bad mount mode specified : %s", mode) } val = fmt.Sprintf("%s:%s:%s", splited[0], containerPath, mode)