Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Commit

Permalink
fix(context): Use SplitN to split CLI variable specifications
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tazjin authored and Vincent Ambo committed Jun 21, 2018
1 parent 01f771f commit 92c5c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 92c5c84

Please sign in to comment.