15 lines
299 B
Go
15 lines
299 B
Go
|
|
package flashscore
|
||
|
|
|
||
|
|
import "time"
|
||
|
|
|
||
|
|
func DiscardScheduledMatchesFurtherThan(matches []ScheduledMatch, furtherThan time.Duration) (result []ScheduledMatch) {
|
||
|
|
now := time.Now()
|
||
|
|
|
||
|
|
for _, m := range matches {
|
||
|
|
if now.Add(furtherThan).After(m.StartTime) {
|
||
|
|
result = append(result, m)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return
|
||
|
|
}
|