diff options
author | Alan Pearce | 2024-05-17 23:21:59 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-17 23:21:59 +0200 |
commit | 6037d5c33e9b98360f61a4fe4f09659d0e3e6160 (patch) | |
tree | 8f45e93faa3ff4bf3a92b06a80e54684283a2c2f /searchix.go | |
parent | 82388e0abb013e3f2cd8c5659be44315658b777a (diff) | |
download | searchix-6037d5c33e9b98360f61a4fe4f09659d0e3e6160.tar.lz searchix-6037d5c33e9b98360f61a4fe4f09659d0e3e6160.tar.zst searchix-6037d5c33e9b98360f61a4fe4f09659d0e3e6160.zip |
fix: duplicate error logging on config parse error
Diffstat (limited to 'searchix.go')
-rw-r--r-- | searchix.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searchix.go b/searchix.go index ba33e3f..c2cd19d 100644 --- a/searchix.go +++ b/searchix.go @@ -62,7 +62,9 @@ func main() { cfg, err := config.GetConfig(*configFile) if err != nil { - log.Panicf("error parsing configuration file: %v", err) + // only use log functions after the config file has been read successfully + fmt.Fprintf(os.Stderr, "error parsing configuration file: %v", err) + os.Exit(1) } slog.SetLogLoggerLevel(cfg.LogLevel) if cfg.Web.Environment == "production" { |