我有一个struct,它由自定义的time.Time组成,为了它具有自定义的MarshalJSON()接口(interface)而定义,以下thisanswer的建议:typeMyTimetime.Timefunc(smyTime)MarshalJSON()([]byte,error){t:=time.Time(s)return[]byte(t.Format(`"20060102T150405Z"`)),nil}我用*MyTime类型的ThisDate和ThatDate字段定义了一个MyStruct类型:typeMyStructstruct{ThisDate*MyTime`json:"