@@ -88,7 +88,7 @@ func GetLanguageByClassifier(content []byte, candidates []string) (language stri
88
88
return getLanguageByStrategy (GetLanguagesByClassifier , "" , content , candidates )
89
89
}
90
90
91
- // GetLanguageByGitattributes returns the language assigned for a given regular expresion in .gitattributes.
91
+ // GetLanguageByGitattributes returns the language assigned to a file for a given regular expresion in .gitattributes.
92
92
// This strategy needs to be initialized calling LoadGitattributes
93
93
func GetLanguageByGitattributes (filename string ) (language string , safe bool ) {
94
94
return getLanguageByStrategy (GetLanguagesByGitattributes , filename , nil , nil )
@@ -442,13 +442,9 @@ func GetLanguageByAlias(alias string) (lang string, ok bool) {
442
442
return
443
443
}
444
444
445
- // GetLanguagesByGitattributes returns the language assigned in .gitattributes if the regular expresion
446
- // matchs with the filename
445
+ // GetLanguagesByGitattributes returns a length 1 slice with the language assigned in .gitattributes if the regular expresion
446
+ // matchs with the filename. It is comply with the signature to be a Strategy type.
447
447
func GetLanguagesByGitattributes (filename string , content []byte , candidates []string ) []string {
448
- return languageByGitattribute (filename )
449
- }
450
-
451
- func languageByGitattribute (filename string ) []string {
452
448
languages := []string {}
453
449
for regExp , language := range languageGitattributes {
454
450
if regExp .MatchString (filename ) {
0 commit comments