encoding/json 的 Marshal/Unmarshal 与 json 标签进阶用法。
type User struct { ID int `json:"id"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` }
data, _ := json.Marshal(user) json.Unmarshal(data, &user)