From 1bbbc0beda0c736c30ad6820936198a884fc6f2f Mon Sep 17 00:00:00 2001 From: 2xsaiko Date: Mon, 6 Jul 2020 15:49:11 +0200 Subject: [PATCH] Use default value for redis-host if value is empty --- gitsrht-keys/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitsrht-keys/main.go b/gitsrht-keys/main.go index bd86c58..d7d0c98 100644 --- a/gitsrht-keys/main.go +++ b/gitsrht-keys/main.go @@ -51,8 +51,8 @@ func main() { logger.Fatalf("Failed to load config file: %v", err) } - redisHost, ok := config.Get("sr.ht", "redis-host") - if !ok { + redisHost, _ := config.Get("sr.ht", "redis-host") + if redisHost == "" { redisHost = "redis://localhost:6379" } ropts, err := goredis.ParseURL(redisHost) -- 2.38.4