From d74fa09743e5006ecb203ec836df7a2086fd0597 Mon Sep 17 00:00:00 2001 From: xoy Date: Sun, 29 Jan 2023 19:00:15 +0100 Subject: [PATCH] fehlerbehebung --- html.go | 2 +- main.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/html.go b/html.go index bc83557..39edfb6 100644 --- a/html.go +++ b/html.go @@ -83,7 +83,7 @@ func htmlReplacer(input string, activePage string) string { if i > 0 { tempB += "!SPLIT" } - tempB += htmlLinkElement(htmlElement("div", tempA, ""), "event/"+string(Event.id), false, "class=\"event\"") + tempB += htmlLinkElement(htmlElement("div", tempA, ""), "event/"+strconv.Itoa(Event.id), false, "class=\"event\"") } output = strings.ReplaceAll(output, "!EVENTS", htmlElement("div", strings.ReplaceAll(tempB, "!SPLIT", ""), "class=\"eventList\"")) tempC := strings.Split(tempB, "!SPLIT") diff --git a/main.go b/main.go index 149ab85..c73d9c9 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "io/ioutil" "net/http" + "strconv" "strings" ) @@ -62,7 +63,7 @@ func handleEvents() { logger("----------------HANDLE EVENTS----------------") events := getEvents() for _, e := range events { - httpHandleFunc("event/"+string(e.id), "./web/pages/event.html", "text/html") + httpHandleFunc("event/"+strconv.Itoa(e.id), "./web/pages/event.html", "text/html") } logger("----------------HANDLE END----------------") }