mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 16:40:08 -03:00
GetLanguage follows strategies shebang, extension, content
This commit is contained in:
parent
c6d74bca66
commit
1b8d51419d
@ -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 := GetLanguageByShebang(content); safe {
|
||||
return lang
|
||||
}
|
||||
|
||||
if lang, safe := GetLanguageByExtension(filename); safe {
|
||||
return lang
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user