mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* Adds root level middleware * Added todo * Better way for extensions to be added. * Bad conflict merge?
22 lines
294 B
Go
22 lines
294 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type Person struct {
|
|
Name string
|
|
}
|
|
|
|
func main() {
|
|
n := os.Getenv("NAME") // can grab name from env or input
|
|
if n == "" {
|
|
n = "World"
|
|
}
|
|
p := &Person{Name: n}
|
|
json.NewDecoder(os.Stdin).Decode(p)
|
|
fmt.Printf("Hello %v!\n", p.Name)
|
|
}
|