Browse Source

verify Fixed webgo/beego's json test

Mike Smith 11 years ago
parent
commit
730691a743
2 changed files with 3 additions and 3 deletions
  1. 1 1
      beego/src/hello/hello.go
  2. 2 2
      webgo/src/hello/hello.go

+ 1 - 1
beego/src/hello/hello.go

@@ -6,7 +6,7 @@ import (
 )
 )
 
 
 type MessageStruct struct {
 type MessageStruct struct {
-	message string `json:"message"`
+	Message string `json:"message"`
 }
 }
 
 
 type JsonController struct {
 type JsonController struct {

+ 2 - 2
webgo/src/hello/hello.go

@@ -9,11 +9,11 @@ import (
 )
 )
 
 
 type MessageStruct struct {
 type MessageStruct struct {
-	Message string
+	Message string `json:"message"`
 }
 }
 
 
 func hello(val string) string {
 func hello(val string) string {
-	m := MessageStruct{"Hello, world"}
+	m := MessageStruct{"Hello, World!"}
 	j, _ := json.Marshal(m)
 	j, _ := json.Marshal(m)
 	return string(j)
 	return string(j)
 }
 }