mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Ignores bad payload and just prints hello world for iron/hello.
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -12,12 +11,9 @@ type Input struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
for _, e := range os.Environ() {
|
|
||||||
fmt.Println(e)
|
|
||||||
}
|
|
||||||
input := &Input{}
|
input := &Input{}
|
||||||
if err := json.NewDecoder(os.Stdin).Decode(input); err != nil {
|
if err := json.NewDecoder(os.Stdin).Decode(input); err != nil {
|
||||||
log.Fatalln("Error! Bad input. ", err)
|
// log.Println("Bad payload or no payload. Ignoring.", err)
|
||||||
}
|
}
|
||||||
if input.Name == "" {
|
if input.Name == "" {
|
||||||
input.Name = "World"
|
input.Name = "World"
|
||||||
|
|||||||
Reference in New Issue
Block a user