Allerhand Kleinigkeiten; Einzelansichten Reihen u Personen; Bandansicht

This commit is contained in:
Simon Martens
2025-02-25 02:39:29 +01:00
parent 6b5fa3dbc3
commit 24f1e4fd55
33 changed files with 843 additions and 154 deletions

View File

@@ -4,6 +4,10 @@ func Length(arr []any) int {
return len(arr)
}
func MapLen[T comparable, U any](m map[T]U) int {
return len(m)
}
func Contains(arr []string, val string) bool {
for _, v := range arr {
if v == val {

View File

@@ -1,6 +1,9 @@
package functions
import "html/template"
import (
"html/template"
"strings"
)
func Safe(s string) template.HTML {
if len(s) == 0 {
@@ -8,3 +11,7 @@ func Safe(s string) template.HTML {
}
return template.HTML(s)
}
func ReplaceSlashParen(s string) string {
return strings.ReplaceAll(s, "/)", "<p>")
}