changes in the API, ready to version 2

This commit is contained in:
Manuel Carmona
2017-05-31 12:07:46 +02:00
parent 5b304524d1
commit 0d5dff1979
23 changed files with 1772 additions and 1448 deletions

View File

@ -4,8 +4,6 @@ import (
"bytes"
"path/filepath"
"strings"
"gopkg.in/toqueteos/substring.v1"
)
var (
@ -46,16 +44,12 @@ func IsDotFile(path string) bool {
// IsVendor returns whether or not path is a vendor path.
func IsVendor(path string) bool {
return findIndex(path, vendorMatchers) >= 0
return vendorMatchers.Match(path)
}
// IsDocumentation returns whether or not path is a documentation path.
func IsDocumentation(path string) bool {
return findIndex(path, documentationMatchers) >= 0
}
func findIndex(path string, matchers substring.StringsMatcher) int {
return matchers.MatchIndex(path)
return documentationMatchers.Match(path)
}
const sniffLen = 8000