From 92c5c846e2ce19c4c46a70a36c533245538c2dd3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 Jun 2018 13:55:59 +0200 Subject: [PATCH] fix(context): Use SplitN to split CLI variable specifications In some cases the value of a variable may contain an equals sign, which would not work in the previous version. This uses `SplitN` to split the variable specifier into a pre-determined number (2) of sub-slices. Further `=`-symbols will then be included in the second substring. --- context/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/context.go b/context/context.go index e6e3d4a12..321d4fa42 100644 --- a/context/context.go +++ b/context/context.go @@ -204,7 +204,7 @@ func loadExplicitVars(vars *[]string) (map[string]interface{}, error) { explicitVars := make(map[string]interface{}, len(*vars)) for _, v := range *vars { - varParts := strings.Split(v, "=") + varParts := strings.SplitN(v, "=", 2) if len(varParts) != 2 { return nil, fmt.Errorf(`invalid explicit variable provided (%s), name and value should be separated with "="`, v) }