Skip to content

Instantly share code, notes, and snippets.

@sciabarracom
Last active September 26, 2019 19:17
Show Gist options
  • Save sciabarracom/a84ce9baa7d8eb7a769f80c61a618694 to your computer and use it in GitHub Desktop.
Save sciabarracom/a84ce9baa7d8eb7a769f80c61a618694 to your computer and use it in GitHub Desktop.
wsk hello.go
FROM actionloop/actionloop-golang-v1.12
ADD exec.zip /action
ENV OW_AUTOINIT=/action/exec.zip
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