From 3b22643733fe8396c84b59efc15fcd223eca3fac Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 10 May 2024 04:59:18 +0400 Subject: [PATCH] In an index.templ a range for was replaced by good old C-style for loop to prevent copying by value, and to get rid of that warning about mutex copy. --- web/index.templ | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/index.templ b/web/index.templ index cd75f73..ce47d6e 100644 --- a/web/index.templ +++ b/web/index.templ @@ -88,15 +88,15 @@ if sl != nil && len(sl) != 0 { - for _, song := range sl { + for i := 0; i < len(sl); i++ { - { utils.ToClientTimezone(song.StartAt, r).Format("15:04") } - if song.MaxListeners != 0 { - { strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.MaxListeners, 10) } + { utils.ToClientTimezone(sl[i].StartAt, r).Format("15:04") } + if sl[i].MaxListeners != 0 { + { strconv.FormatInt(sl[i].Listeners, 10) }/{ strconv.FormatInt(sl[i].MaxListeners, 10) } } else { } - { song.Artist } - { song.Title } + { sl[i].Artist } - { sl[i].Title } }