From 72b511a120ad7941fede586538384f3d02052438 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 24 Jul 2022 04:42:44 +0200 Subject: [PATCH] Fix config parsing --- internal/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index bb5fead..400dc32 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -29,12 +29,14 @@ type ServerConfig struct { ListenAddress string `json:"listen_address"` } -func ParseFromFile(path string) (config *Config, err error) { +func ParseFromFile(path string) (*Config, error) { data, err := os.ReadFile(path) if err != nil { return nil, err } + config := &Config{} + err = json.Unmarshal(data, config) if err != nil { return nil, err