17 lines
363 B
Go
17 lines
363 B
Go
|
package main
|
||
|
|
||
|
import "github.com/icedream/go-footballdata"
|
||
|
|
||
|
type timeSortedMatches []*footballdata.Fixture
|
||
|
|
||
|
func (slice timeSortedMatches) Len() int {
|
||
|
return len(slice)
|
||
|
}
|
||
|
|
||
|
func (slice timeSortedMatches) Less(i, j int) bool {
|
||
|
return slice[i].Date.Before(slice[j].Date)
|
||
|
}
|
||
|
func (slice timeSortedMatches) Swap(i, j int) {
|
||
|
slice[i], slice[j] = slice[j], slice[i]
|
||
|
}
|