🎨 Format files

This commit is contained in:
2025-04-03 05:01:22 +04:00
parent e80ae9ab24
commit 42d5617e3f
16 changed files with 55 additions and 49 deletions

View File

@@ -34,7 +34,7 @@ func (config *Config) ReadFile(filePath types.ConfigFile) error {
if err != nil {
return fmt.Errorf("failed to fetch config file from %s", filePath)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
data, err = io.ReadAll(io.Reader(resp.Body))
if err != nil {
@@ -47,9 +47,10 @@ func (config *Config) ReadFile(filePath types.ConfigFile) error {
}
}
if fileExt == "json" {
switch fileExt {
case "json":
return parseJSONConfig(data, config)
} else if fileExt == "yml" || fileExt == "yaml" {
case "yml", "yaml":
return parseYAMLConfig(data, config)
}
}