mirror of
https://github.com/nkanaev/yarr.git
synced 2026-04-30 22:37:42 +00:00
cmd: modernize -fix ./cmd/...
This commit is contained in:
@@ -2,6 +2,7 @@ package scraper
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/nkanaev/yarr/src/content/htmlutil"
|
||||
@@ -22,10 +23,8 @@ func FindFeeds(body string, base string) map[string]string {
|
||||
isFeedLink := func(n *html.Node) bool {
|
||||
if n.Type == html.ElementNode && n.Data == "link" {
|
||||
t := htmlutil.Attr(n, "type")
|
||||
for _, tt := range linkTypes {
|
||||
if tt == t {
|
||||
return true
|
||||
}
|
||||
if slices.Contains(linkTypes, t) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user