Files
fn-serverless/examples/inputs/func.go
Travis Reeder 5219227393 Updated docs on configuration and required env vars. (#285)
* Updated docs on configuration and required env vars.

* minor
2017-09-29 16:20:46 -07:00

22 lines
388 B
Go

package main
import (
"encoding/json"
"fmt"
"os"
)
type Person struct {
Name string
}
func main() {
p := &Person{Name: "World"}
json.NewDecoder(os.Stdin).Decode(p)
mapD := map[string]string{"message": fmt.Sprintf("Hello %s", p.Name)}
mapD["SECRET_1"] = os.Getenv("SECRET_1")
mapD["SECRET_2"] = os.Getenv("SECRET_2")
mapB, _ := json.Marshal(mapD)
fmt.Println(string(mapB))
}