Last active
September 26, 2019 19:17
-
-
Save sciabarracom/a84ce9baa7d8eb7a769f80c61a618694 to your computer and use it in GitHub Desktop.
wsk hello.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM actionloop/actionloop-golang-v1.12 | |
ADD exec.zip /action | |
ENV OW_AUTOINIT=/action/exec.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// Main function for the action | |
func Main(obj map[string]interface{}) map[string]interface{} { | |
name, ok := obj["name"].(string) | |
if !ok { | |
name = "world" | |
} | |
fmt.Printf("name=%s\n", name) | |
msg := make(map[string]interface{}) | |
msg["golang-main-single"] = "Hello, " + name + "!" | |
return msg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment