diff --git a/internal/lsp/source/util.go b/internal/lsp/source/util.go index 443bda8eec..56974f22d1 100644 --- a/internal/lsp/source/util.go +++ b/internal/lsp/source/util.go @@ -178,25 +178,6 @@ func FileKindForLang(langID string) FileKind { } } -func DetectLanguage(langID, filename string) FileKind { - // use the langID if the client sent it - if kind := FileKindForLang(langID); kind != UnknownKind { - return kind - } - // Detect the language based on the file extension. - switch ext := filepath.Ext(filename); ext { - case ".mod": - return Mod - case ".sum": - return Sum - case ".go": - return Go - default: - // (for instance, before go1.15 cgo files had no extension) - return Go - } -} - func (k FileKind) String() string { switch k { case Go: