From 2f249d62905eb2c6a61703c6cddc317d071b124f Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 14 Jan 2022 18:00:03 +0100 Subject: slugify: use builder facilities --- skate/slugify.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'skate') diff --git a/skate/slugify.go b/skate/slugify.go index 5cdc838..d817485 100644 --- a/skate/slugify.go +++ b/skate/slugify.go @@ -1,7 +1,6 @@ package skate import ( - "fmt" "strings" ) @@ -10,7 +9,7 @@ func slugifyString(s string) string { var sb strings.Builder for _, c := range strings.TrimSpace(strings.ToLower(s)) { if (c > 96 && c < 123) || (c > 47 && c < 58) || (c == 32) || (c == 9) || (c == 10) { - fmt.Fprintf(&sb, "%c", c) + _, _ = sb.WriteRune(c) } } return strings.Join(strings.Fields(sb.String()), " ") -- cgit v1.2.3