Merge pull request #2 from mvader/make-langs-public
Make ExtensionsByLanguage public
This commit is contained in:
commit
11717692b5
@ -3,7 +3,7 @@ package slinguist
|
|||||||
const OtherLanguage = "Other"
|
const OtherLanguage = "Other"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
extensionsByLanguage map[string][]string
|
ExtensionsByLanguage map[string][]string
|
||||||
ignoredExtensions = map[string]bool{
|
ignoredExtensions = map[string]bool{
|
||||||
".asc": true, ".cgi": true, ".fcgi": true, ".gml": true, ".fx": true,
|
".asc": true, ".cgi": true, ".fcgi": true, ".gml": true, ".fx": true,
|
||||||
".vhost": true,
|
".vhost": true,
|
||||||
@ -25,13 +25,13 @@ func init() {
|
|||||||
languagesByExtension[l] = []string{OtherLanguage}
|
languagesByExtension[l] = []string{OtherLanguage}
|
||||||
}
|
}
|
||||||
|
|
||||||
extensionsByLanguage = reverseStringListMap(languagesByExtension)
|
ExtensionsByLanguage = reverseStringListMap(languagesByExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLanguageExtensions returns the different extensions being used by the
|
// GetLanguageExtensions returns the different extensions being used by the
|
||||||
// language.
|
// language.
|
||||||
func GetLanguageExtensions(language string) []string {
|
func GetLanguageExtensions(language string) []string {
|
||||||
return extensionsByLanguage[language]
|
return ExtensionsByLanguage[language]
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLanguage return the Language for a given filename and file content.
|
// GetLanguage return the Language for a given filename and file content.
|
||||||
|
Loading…
Reference in New Issue
Block a user