From dc9741b798b10e28736700d004a25879fa25587a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Wed, 11 Sep 2024 22:02:50 +0200 Subject: [PATCH] config: ReadConfig -> Read The function is already in the config package, the old naming is redundant. --- config/config.go | 4 ++-- config/config_test.go | 2 +- main.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index 02da796..f1e09ea 100644 --- a/config/config.go +++ b/config/config.go @@ -385,8 +385,8 @@ func parseBlock(block scfg.Block, config *Config) error { return nil } -// ReadConfig reads an scfg formatted file and returns the configuration struct. -func ReadConfig(path string) (*Config, error) { +// Read reads an scfg formatted file and returns the configuration struct. +func Read(path string) (*Config, error) { cfg, err := scfg.Load(path) if err != nil { return nil, err diff --git a/config/config_test.go b/config/config_test.go index cc317e1..0e61153 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -117,7 +117,7 @@ cache { t.Errorf("failed to write config file: %v", err) } - cfg, err := ReadConfig(configPath) + cfg, err := Read(configPath) if err != nil { t.Errorf("failed to read config file: %v", err) } diff --git a/main.go b/main.go index d5520d0..5ae251e 100644 --- a/main.go +++ b/main.go @@ -498,7 +498,7 @@ func main() { os.Exit(0) } - cfg, err := config.ReadConfig(configPath) + cfg, err := config.Read(configPath) if err != nil { slog.Error("Failed to read config", slog.String("error", err.Error())) -- 2.48.1