added language detection by filename strategy

This commit is contained in:
Manuel Carmona
2017-04-19 10:59:34 +02:00
parent 645bdd7331
commit df60eab1ad
3 changed files with 42 additions and 1 deletions

View File

@@ -36,6 +36,10 @@ func GetLanguageExtensions(language string) []string {
// GetLanguage return the Language for a given filename and file content.
func GetLanguage(filename string, content []byte) string {
if lang, safe := GetLanguageByFilename(filename); safe {
return lang
}
if lang, safe := GetLanguageByShebang(content); safe {
return lang
}