squakez commented on a change in pull request #2369:
URL: https://github.com/apache/camel-k/pull/2369#discussion_r646615175
##########
File path: pkg/cmd/run.go
##########
@@ -809,10 +817,19 @@ func loadPropertyFile(fileName string)
(*properties.Properties, error) {
return p, nil
}
-func escapePropertyFileItem(item string) string {
- item = strings.ReplaceAll(item, `=`, `\=`)
- item = strings.ReplaceAll(item, `:`, `\:`)
- return item
+func toPropertyEntry(props *properties.Properties, key string) (string, error)
{
Review comment:
The function is repeated in another unit, I'd avoid to include repeated
code.
##########
File path: pkg/cmd/run.go
##########
@@ -809,10 +817,19 @@ func loadPropertyFile(fileName string)
(*properties.Properties, error) {
return p, nil
}
-func escapePropertyFileItem(item string) string {
- item = strings.ReplaceAll(item, `=`, `\=`)
- item = strings.ReplaceAll(item, `:`, `\:`)
- return item
+func toPropertyEntry(props *properties.Properties, key string) (string, error)
{
+ value, _ := props.Get(key)
Review comment:
I think we can instead provide that `value` variable as a input variable
of the fuction. You only use `props` to extract this value AFAICS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]