1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

If there are year folders in directory listings, fetch files from the extra level.

This commit is contained in:
Sascha L. Teichmann 2022-05-17 15:58:34 +02:00
parent 29f26e0299
commit 131a7155fa
3 changed files with 85 additions and 30 deletions

View file

@ -24,9 +24,16 @@ const page0 = `<html>
func TestLinksOnPage(t *testing.T) {
links, err := linksOnPage(
var links []string
err := linksOnPage(
strings.NewReader(page0),
func(s string) (string, error) { return s, nil },
func(s string) error {
if strings.HasSuffix(s, ".json") {
links = append(links, s)
}
return nil
},
)
if err != nil {
t.Fatal(err)