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.
This commit is contained in:
Vincent Ambo 2018-06-21 13:55:59 +02:00 committed by Vincent Ambo
parent 01f771fa2f
commit 92c5c846e2

View file

@ -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)
}