Update for testing functions.

This commit is contained in:
Travis Reeder
2017-07-17 11:41:10 -07:00
parent c605317250
commit f8b8c6f7e8
6 changed files with 200 additions and 49 deletions

View File

@@ -14,7 +14,10 @@ type Person struct {
func main() {
p := &Person{Name: "World"}
json.NewDecoder(os.Stdin).Decode(p)
fmt.Printf("Hello %v!\n", p.Name)
// fmt.Printf("Hello %v!\n", p.Name)
mapD := map[string]string{"message": fmt.Sprintf("Hello %s", p.Name)}
mapB, _ := json.Marshal(mapD)
fmt.Println(string(mapB))
log.Println("---> stderr goes to the server logs.")
log.Println("---> LINE 2")

View File

@@ -0,0 +1,26 @@
{
"tests": [
{
"input": {
"body": {
"name": "Johnny"
}
},
"output": {
"body": {
"message": "Hello Johnny"
}
}
},
{
"input": {
"body": ""
},
"output": {
"body": {
"message": "Hello World"
}
}
}
]
}