From 3df825260d577ac6e3c4871a6c198af06755300b Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 10 Jun 2021 02:44:47 +0200 Subject: make prefix helper public --- skate/cmd/skate-cleanup/main.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'skate/cmd') diff --git a/skate/cmd/skate-cleanup/main.go b/skate/cmd/skate-cleanup/main.go index 72b258a..d4d5f5a 100644 --- a/skate/cmd/skate-cleanup/main.go +++ b/skate/cmd/skate-cleanup/main.go @@ -59,15 +59,6 @@ func main() { } } -func hasAnyPrefix(s string, prefixes []string) bool { - for _, p := range prefixes { - if strings.HasPrefix(s, p) { - return true - } - } - return false -} - // urlFilter parses finds the first URL. func urlFilter(p []byte) ([]byte, error) { parts := strings.Split(string(p), *delimiter) @@ -87,7 +78,7 @@ func urlFilter(p []byte) ([]byte, error) { if url == "" && *skipNonMatches { return nil, nil } - if len(allowedSchemas) > 0 && !hasAnyPrefix(url, allowedSchemas) { + if len(allowedSchemas) > 0 && !skate.HasAnyPrefix(url, allowedSchemas) { return nil, nil } if len(parts) == 1 || *index == len(parts) { -- cgit v1.2.3