From cac48f1ec6201b72fd40666764b3cb7bc18331a1 Mon Sep 17 00:00:00 2001 From: Seiya Miyata Date: Thu, 18 May 2023 17:40:00 +0900 Subject: [PATCH] Fix not to assign a value to toBind Signed-off-by: Seiya Miyata --- cli/command/container/opts.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index a68bbe4833..578f4dc099 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -360,13 +360,12 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con toBind := bind if parsed.Type == string(mounttypes.TypeBind) { - if hostPart, targetPath, ok := strings.Cut(bind, ":"); ok { + if hostPart, _, ok := strings.Cut(bind, ":"); ok { if strings.HasPrefix(hostPart, "."+string(filepath.Separator)) || hostPart == "." { if absHostPart, err := filepath.Abs(hostPart); err == nil { hostPart = absHostPart } } - toBind = hostPart + ":" + targetPath } }