config: ReadConfig -> Read

The function is already in the config package, the old naming is
redundant.
This commit is contained in:
Thorben Günther 2024-09-11 22:02:50 +02:00
parent 6c2521eeca
commit dc9741b798
No known key found for this signature in database
GPG key ID: 415CD778D8C5AFED
3 changed files with 4 additions and 4 deletions

View file

@ -385,8 +385,8 @@ func parseBlock(block scfg.Block, config *Config) error {
return nil return nil
} }
// ReadConfig reads an scfg formatted file and returns the configuration struct. // Read reads an scfg formatted file and returns the configuration struct.
func ReadConfig(path string) (*Config, error) { func Read(path string) (*Config, error) {
cfg, err := scfg.Load(path) cfg, err := scfg.Load(path)
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -117,7 +117,7 @@ cache {
t.Errorf("failed to write config file: %v", err) t.Errorf("failed to write config file: %v", err)
} }
cfg, err := ReadConfig(configPath) cfg, err := Read(configPath)
if err != nil { if err != nil {
t.Errorf("failed to read config file: %v", err) t.Errorf("failed to read config file: %v", err)
} }

View file

@ -498,7 +498,7 @@ func main() {
os.Exit(0) os.Exit(0)
} }
cfg, err := config.ReadConfig(configPath) cfg, err := config.Read(configPath)
if err != nil { if err != nil {
slog.Error("Failed to read config", slog.Error("Failed to read config",
slog.String("error", err.Error())) slog.String("error", err.Error()))