package main
import (
"encoding/json"
"fmt"
)
type List struct {
Content string `json:"content,omitempty"`
ToUser struct {
ID int `json:"id"`
} `json:"to_user,omitempty"`
}
func main() {
var list []List
list = append(list, List{
Content: "hello world",
}, List{
ToUser: , //在这个环节赋值,我不知道怎么处理了
})
res, err := json.Marshal(list)
if err != nil {
panic(err)
}
fmt.Println(string(res))
}