From 40c99caa387e22cd3257fd578b3eedd610959a03 Mon Sep 17 00:00:00 2001 From: Ivan Kropotkin Date: Sat, 20 Jul 2024 12:16:16 +0200 Subject: [PATCH] fix randomAd --- ui/ui.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/ui.go b/ui/ui.go index 48f9a3c4..76d429ee 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -7,11 +7,13 @@ import ( html_template "html/template" "io" "log" + "math/rand" "net/http" "path/filepath" "runtime" "strings" text_template "text/template" + "time" "github.com/itpp-labs/hound/config" ) @@ -179,6 +181,8 @@ func renderForPrd(w io.Writer, c *content, cfg *config.Config, cfgJson string, i } buf.WriteString("") + var randomAd string // Initialize randomAd with an empty string + if cfg.Ads != nil && len(cfg.Ads) > 0 { // Seed the random number generator (typically done once) rand.Seed(time.Now().UnixNano())