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:
parent
01f771fa2f
commit
92c5c846e2
1 changed files with 1 additions and 1 deletions
|
@ -204,7 +204,7 @@ func loadExplicitVars(vars *[]string) (map[string]interface{}, error) {
|
||||||
explicitVars := make(map[string]interface{}, len(*vars))
|
explicitVars := make(map[string]interface{}, len(*vars))
|
||||||
|
|
||||||
for _, v := range *vars {
|
for _, v := range *vars {
|
||||||
varParts := strings.Split(v, "=")
|
varParts := strings.SplitN(v, "=", 2)
|
||||||
if len(varParts) != 2 {
|
if len(varParts) != 2 {
|
||||||
return nil, fmt.Errorf(`invalid explicit variable provided (%s), name and value should be separated with "="`, v)
|
return nil, fmt.Errorf(`invalid explicit variable provided (%s), name and value should be separated with "="`, v)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue