jjzjj

ByDatetimeRecorded

全部标签

arrays - Go:对数组进行排序,如果在 `Less(i, j int)` 中发现错误则丢弃元素

给定以下结构typePointstruct{datetimeRecordedtime.Time}//Returnstrueifthepointwasrecordedbeforethecomparisonpoint.//Ifdatetimeisnotavailablereturnfalseandanerrorfunc(p1Point)RecordedBefore(p2Point)(isBeforebool,errerror){if(p1.datetimeRecorded.IsZero())||(p2.datetimeRecorded.IsZero()){err=ErrNoDatetime