ningyougang commented on code in PR #170:
URL: 
https://github.com/apache/openwhisk-runtime-go/pull/170#discussion_r937249726


##########
tests/src/test/scala/runtime/actionContainers/ActionLoopGoContainerTests.scala:
##########
@@ -135,4 +135,28 @@ abstract class ActionLoopGoContainerTests
       c.run(helloMsg()) should be(okMsg("hello-Hello", "Hello, Demo!"))
     }
   }
+
+  it should "support return array result" in {
+    val helloArrayGo = {
+      s"""
+         |package main
+         |
+         |func Main(obj map[string]interface{}) []interface{} {

Review Comment:
   for JSON array params, can use like blow
   ```
   // Main is the function implementing the action
   func Main(event []interface{}) []interface{} {
        input := make([]string, len(event))
        for i, v := range event {
                input[i] = fmt.Sprint(v)
        }
        sort.Strings(input)
        output := make([]interface{}, len(event))
        for i, v := range input {
                output[i] = v
        }
        return output
   }
   ```
   
   hm..it is better to add a test case for json array params as well.



-- 
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]

Reply via email to