mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-18 22:23:07 -03:00
changes in the API, ready to version 2
This commit is contained in:
10
utils.go
10
utils.go
@ -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
|
||||
|
Reference in New Issue
Block a user