From 16d0bd7ca410274c2796cf6f70eb82614b8b865f Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sat, 31 Aug 2024 18:04:53 +0200 Subject: [PATCH] util/config.go auto formatting --- util/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util/config.go b/util/config.go index a7788b9..f983da2 100644 --- a/util/config.go +++ b/util/config.go @@ -6,21 +6,21 @@ import ( "os" ) -func ReadConfigs() ([]Config, error) { - file, readErr := os.Open("configs.json") +func ReadConfigs() ([]*Config, error) { + file, err := os.Open("configs.json") - if readErr != nil { - return nil, readErr + if err != nil { + return nil, err } defer file.Close() bytes, _ := io.ReadAll(file) - var config []Config - unmarshalErr := json.Unmarshal(bytes, &config) + var config []*Config + err = json.Unmarshal(bytes, &config) - if unmarshalErr != nil { - return nil, unmarshalErr + if err != nil { + return nil, err } return config, nil }