package main
import (
"encoding/json"
"fmt"
)
// User is
type User struct {
Email string `json:"email"`
Password string `json:"password"`
}
// Blog is
type Blog struct {
Title string `json:"title"`
Content string `json:"content"`
}
func main() {
b := new(Blog)
u := new(User)
json.Unmarshal([]byte(
`{
"email":"lishude",
"password":"test",
"title": "hello",
"content": "content"
}`),
&struct {
*User
*Blog
}{u, b})
fmt.Println(b)
fmt.Println(u)
}