Bug fix on isValidFile
This commit is contained in:
parent
2b438d3578
commit
2df33fe301
|
@ -135,16 +135,17 @@ func (tf *TodoFinder) FindInDir(dir string) error {
|
|||
}
|
||||
|
||||
func (tf TodoFinder) isValidFile(name string) bool {
|
||||
valid := false
|
||||
for _, ft := range tf.repo.FileTypes {
|
||||
ftl := len(ft) + 1
|
||||
if len(name) < ftl {
|
||||
return false
|
||||
}
|
||||
last := name[ftl:]
|
||||
valid = last == "."+ft
|
||||
last := name[len(name)-ftl:]
|
||||
if last == "."+ft {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return valid
|
||||
return false
|
||||
}
|
||||
|
||||
func (tf TodoFinder) buildRegexPattern() string {
|
||||
|
|
Loading…
Reference in New Issue