diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-06-10 02:44:47 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-06-10 02:44:47 +0200 |
commit | 3df825260d577ac6e3c4871a6c198af06755300b (patch) | |
tree | 4798a9d496ff93feacc36f9f640e4039765fa374 /skate/cmd | |
parent | 4044d9753da11e7e66234621f52b3dcd04f73b41 (diff) | |
download | refcat-3df825260d577ac6e3c4871a6c198af06755300b.tar.gz refcat-3df825260d577ac6e3c4871a6c198af06755300b.zip |
make prefix helper public
Diffstat (limited to 'skate/cmd')
-rw-r--r-- | skate/cmd/skate-cleanup/main.go | 11 |
1 files changed, 1 insertions, 10 deletions
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) { |