Skip to content

Commit 0f4ea57

Browse files
apply pr suggestion: trim StringList values from gherkin tests
Signed-off-by: Alexandra Oberaigner <[email protected]>
1 parent d2cffdd commit 0f4ea57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/flagd/testframework/utils.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ func (vc *ValueConverter) ConvertToReflectValue(valueType, value string, fieldTy
7979
}
8080
return reflect.ValueOf(longVal).Convert(fieldType)
8181
case "StringList":
82-
arrayVal := strings.Split(value, ",")
83-
return reflect.ValueOf(arrayVal).Convert(fieldType)
82+
splitVal := strings.Split(value, ",")
83+
for i, v := range splitVal {
84+
splitVal[i] = strings.TrimSpace(v)
85+
}
86+
return reflect.ValueOf(splitVal).Convert(fieldType)
8487
default:
8588
return reflect.ValueOf(value).Convert(fieldType)
8689
}

0 commit comments

Comments
 (0)