Ignores bad payload and just prints hello world for iron/hello.

This commit is contained in:
Travis Reeder
2016-10-12 12:45:09 -07:00
parent 75383d060f
commit 777dc9dbb2

View File

@@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"log"
"os"
)
@@ -12,12 +11,9 @@ type Input struct {
}
func main() {
for _, e := range os.Environ() {
fmt.Println(e)
}
input := &Input{}
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 == "" {
input.Name = "World"