DetectLanguage returns the language name for a file path
(filePath string)
| 94 | |
| 95 | // DetectLanguage returns the language name for a file path |
| 96 | func DetectLanguage(filePath string) string { |
| 97 | ext := strings.ToLower(filepath.Ext(filePath)) |
| 98 | return extToLang[ext] |
| 99 | } |
| 100 | |
| 101 | // IsSourceExt returns true if the extension (with leading dot) is a recognized source file. |
| 102 | func IsSourceExt(ext string) bool { |
no outgoing calls