IsConfiguration: add&fix failing Python case to Go

test plan:
 * ENRY_TEST_REPO=".linguist" \
    go test -run '^TestIsConfiguration$' github.com/go-enry/go-enry/v2
This commit is contained in:
Alex Bezzubov
2023-09-22 14:36:21 +02:00
parent 84c996dfcf
commit 7db593cb32
2 changed files with 9 additions and 7 deletions

View File

@ -12,15 +12,16 @@ import (
const binSniffLen = 8000
var configurationLanguages = map[string]struct{}{
"XML": {},
"JSON": {},
"TOML": {},
"YAML": {},
"INI": {},
"SQL": {},
"XML": {},
"JSON": {},
"TOML": {},
"YAML": {},
"MiniYAML": {},
"INI": {},
"SQL": {},
}
// IsConfiguration tells if filename is in one of the configuration languages.
// IsConfiguration tells if a give file is in one of the configuration languages.
func IsConfiguration(path string) bool {
language, _ := GetLanguageByExtension(path)
_, is := configurationLanguages[language]