From 481cdf9cf3a1048e4d14f08409b4129ccb957767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20=C5=9Eiar=20Baysal?= Date: Thu, 20 Jul 2023 20:11:06 +0300 Subject: [PATCH] h err --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 21d8d86..2e27d2a 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,10 @@ var reqCounter = prometheus.NewCounter( func sendEpoch(w http.ResponseWriter, r *http.Request) { epoch := time.Now().UTC().Unix() - hostname := os.Hostname() + hostname, err := os.Hostname() + if err != nil { + fmt.Println(err) + } reqCounter.Inc() fmt.Fprintf(w, "{\"host\": %s, \"type\": \"epoch\", \"data\": %d, \"unit\": \"sec\", \"rev\": %q}", hostname, epoch, Version) }