Files
fn-serverless/examples/hello-go/function.go
Carlos C d5fb1afda7 Revert "Assert License (#224)"
This reverts commit a61c4dab78.
2016-11-06 09:25:12 -08:00

23 lines
359 B
Go

package main
import (
"encoding/json"
"fmt"
"os"
)
type Input struct {
Name string `json:"name"`
}
func main() {
input := &Input{}
if err := json.NewDecoder(os.Stdin).Decode(input); err != nil {
// log.Println("Bad payload or no payload. Ignoring.", err)
}
if input.Name == "" {
input.Name = "World"
}
fmt.Printf("Hello %v!\n", input.Name)
}