Merge pull request #714 from sunzhaochang/fix-struct-json-tag

Fix struct tag for json
This commit is contained in:
Paul Yuknewicz 2022-08-02 08:23:26 -07:00 committed by GitHub
commit 37b6f5cfd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -35,13 +35,13 @@ var (
)
type Orders struct {
Orders []Order `json:orders`
Orders []Order `json:"orders"`
}
type Order struct {
OrderId int `json:orderid`
Customer string `json:customer`
Price float64 `json:price`
OrderId int `json:"orderid"`
Customer string `json:"customer"`
Price float64 `json:"price"`
}
func processBatch(w http.ResponseWriter, r *http.Request) {

View File

@ -36,13 +36,13 @@ var (
)
type Orders struct {
Orders []Order `json:orders`
Orders []Order `json:"orders"`
}
type Order struct {
OrderId int `json:orderid`
Customer string `json:customer`
Price float64 `json:price`
OrderId int `json:"orderid"`
Customer string `json:"customer"`
Price float64 `json:"price"`
}
func processBatch(w http.ResponseWriter, r *http.Request) {