diff --git a/core/config.go b/core/config.go index 5892226b..c845e847 100644 --- a/core/config.go +++ b/core/config.go @@ -57,7 +57,7 @@ func GetFormatByExtension(ext string) string { return "yaml" case "toml": return "toml" - case "json": + case "json", "jsonc": return "json" default: return "" diff --git a/main/run.go b/main/run.go index 97967700..1f8a4b88 100644 --- a/main/run.go +++ b/main/run.go @@ -113,13 +113,13 @@ func dirExists(file string) bool { func getRegepxByFormat() string { switch strings.ToLower(*format) { case "json": - return `^.+\.json$` + return `^.+\.(json|jsonc)$` case "toml": return `^.+\.toml$` case "yaml", "yml": return `^.+\.(yaml|yml)$` default: - return `^.+\.(json|toml|yaml|yml)$` + return `^.+\.(json|jsonc|toml|yaml|yml)$` } }