~xenrox/ntfy-alertmanager

dc9741b798b10e28736700d004a25879fa25587a — Thorben Günther 2 months ago 6c2521e
config: ReadConfig -> Read

The function is already in the config package, the old naming is
redundant.
3 files changed, 4 insertions(+), 4 deletions(-)

M config/config.go
M config/config_test.go
M main.go
M config/config.go => config/config.go +2 -2
@@ 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

M config/config_test.go => config/config_test.go +1 -1
@@ 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)
	}

M main.go => main.go +1 -1
@@ 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()))