()
| 91 | } |
| 92 | |
| 93 | func Load() Config { |
| 94 | cfg := DefaultConfig() |
| 95 | |
| 96 | configPath := getConfigFilePath() |
| 97 | if configPath == "" { |
| 98 | return cfg |
| 99 | } |
| 100 | |
| 101 | data, err := os.ReadFile(configPath) |
| 102 | if err != nil { |
| 103 | return cfg |
| 104 | } |
| 105 | |
| 106 | if err := yaml.Unmarshal(data, &cfg); err != nil { |
| 107 | return DefaultConfig() |
| 108 | } |
| 109 | |
| 110 | return cfg |
| 111 | } |
no test coverage detected