package main import ( "bufio" "context" "fmt" "log" "os" "sort" "strings" "time" "github.com/mmcdole/gofeed" ) type RSSInfo struct { Items []gofeed.Item } // Len returns the length of Items. func (f RSSInfo) Len() int { return len(f.Items) } // Less compares PublishedParsed of Items[i], Items[k] // and returns true if Items[i] is less than Items[k]. func (f RSSInfo) Less(i, k int) bool { return f.Items[k].PublishedParsed.Before( *f.Items[i].PublishedParsed, ) } // Swap swaps Items[i] and Items[k]. func (f RSSInfo) Swap(i, k int) { f.Items[i], f.Items[k] = f.Items[k], f.Items[i] } func main() { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") fmt.Println("") }