latest linguist patterns 36ba3783443275525fff7b72b633a3bccfb132cb

This commit is contained in:
Máximo Cuadros
2016-07-14 00:08:09 +02:00
parent bead3a606f
commit 947a0d3d44
4 changed files with 1041 additions and 790 deletions

View File

@ -2,11 +2,14 @@ package slinguist
import (
"path/filepath"
"strings"
)
func GetLanguageByExtension(filename string) (lang string, safe bool) {
ext := strings.ToLower(filepath.Ext(filename))
lang = OtherLanguage
langs, ok := LanguagesByExtension[filepath.Ext(filename)]
langs, ok := LanguagesByExtension[ext]
if !ok {
return
}