给出下面的结构
type SortDateExample struct {
sortByThis time.Time
id string
}
然后切片初始化了
之类的东西var datearray = var alerts = make([]SortDateExample, 0)
dateSlice = append(dateSlice,newSortDateExmple)
dateSlice = append(dateSlice,newSortDateExmple2)
dateSlice = append(dateSlice,newSortDateExmple3)
在golang 1.12中,我可以在不建立辅助数据结构的情况下对该数组进行排序吗? 例如此问题Sorting by time.Time in Golang中显示的内容?