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 {
|
func (tf TodoFinder) isValidFile(name string) bool {
|
||||||
valid := false
|
|
||||||
for _, ft := range tf.repo.FileTypes {
|
for _, ft := range tf.repo.FileTypes {
|
||||||
ftl := len(ft) + 1
|
ftl := len(ft) + 1
|
||||||
if len(name) < ftl {
|
if len(name) < ftl {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
last := name[ftl:]
|
last := name[len(name)-ftl:]
|
||||||
valid = last == "."+ft
|
if last == "."+ft {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
return valid
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tf TodoFinder) buildRegexPattern() string {
|
func (tf TodoFinder) buildRegexPattern() string {
|
||||||
|
|
Loading…
Reference in New Issue