mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
check for extension and filename first, without load a file content
removed language and ok variables declaration
This commit is contained in:
parent
d3f79d9a37
commit
761029c3a5
@ -61,16 +61,21 @@ func main() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
content, err := ioutil.ReadFile(path)
|
language, ok := enry.GetLanguageByExtension(path)
|
||||||
if err != nil {
|
if !ok {
|
||||||
errors = true
|
if language, ok = enry.GetLanguageByFilename(path); !ok {
|
||||||
log.Println(err)
|
content, err := ioutil.ReadFile(path)
|
||||||
return nil
|
if err != nil {
|
||||||
}
|
errors = true
|
||||||
|
log.Println(err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
language := enry.GetLanguage(filepath.Base(path), content)
|
language = enry.GetLanguage(filepath.Base(path), content)
|
||||||
if language == enry.OtherLanguage {
|
if language == enry.OtherLanguage {
|
||||||
return nil
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out[language] = append(out[language], relativePath)
|
out[language] = append(out[language], relativePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user