style95 commented on code in PR #516:
URL: https://github.com/apache/openwhisk-cli/pull/516#discussion_r950934720
##########
commands/util.go:
##########
@@ -604,16 +604,20 @@ func getChildValueStrings(keyValueArr whisk.KeyValueArr,
key string, childKey st
return res
}
-func getValueFromJSONResponse(field string, response map[string]interface{})
interface{} {
+func getValueFromJSONResponse(field string, response interface{}) interface{} {
var res interface{}
- for key, value := range response {
- if key == field {
- res = value
- break
+ if result, ok := response.(map[string]interface{}); ok {
+ for key, value := range result {
+ if key == field {
+ res = value
+ break
+ }
}
}
-
+ if result, ok := response.([]interface{}); ok {
Review Comment:
@ningyougang
This method was used to print the invocation result.
https://github.com/apache/openwhisk-cli/blob/92c251f5d3a873029ccd8d815409582301d1103d/commands/action.go#L238
Do we need to print the array result itself for the array case?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]