From b9ab2938065dac4089f73ce03dd3527915e60947 Mon Sep 17 00:00:00 2001 From: "n.pavlovich" Date: Tue, 3 Dec 2024 09:46:12 +0300 Subject: [PATCH] fix tests --- dump.go | 2 +- utils.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dump.go b/dump.go index f35bb3a..6c158c0 100644 --- a/dump.go +++ b/dump.go @@ -95,7 +95,7 @@ func (d *FileDumper) GetDump() (string, error) { files, err := os.ReadDir(d.Path) if err != nil { - log.Fatal(err) + return "", err } dumpFiles := make([]string, 0) for _, f := range files { diff --git a/utils.go b/utils.go index 0ee6a6b..54926e4 100644 --- a/utils.go +++ b/utils.go @@ -29,11 +29,11 @@ type Config struct { DumpCheckInterval int `json:"dump_check_interval"` DumpDir string `json:"dump_dir"` Debug bool `json:"debug"` - LogQueries bool `json:"log_queries"` + LogQueries bool `json:"log_queries"` MetricsPrefix string `json:"metrics_prefix"` UseTLS bool `json:"use_tls"` - TLSCertFile string `json:"tls_cert_file"` - TLSKeyFile string `json:"tls_key_file"` + TLSCertFile string `json:"tls_cert_file"` + TLSKeyFile string `json:"tls_key_file"` } // ReadJSON - read json file to struct @@ -86,7 +86,7 @@ func ReadConfig(configFile string) (Config, error) { cnf := Config{} err := ReadJSON(configFile, &cnf) if err != nil { - log.Printf("INFO: Config file %+v not found. Used%+v\n", configFile, sampleConfig) + log.Printf("INFO: Config file %+v not found. Used %+v\n", configFile, sampleConfig) err = ReadJSON(sampleConfig, &cnf) if err != nil { log.Printf("ERROR: read %+v failed\n", sampleConfig)