json.Marshal(x) json.MarshalIndent(x, "", " ") tag `json:"xxxx,omitempty"` omitempty表示如果只为零值或者空,则不输出这个成员到JSON中