aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2022-01-14 18:00:03 +0100
committerMartin Czygan <martin.czygan@gmail.com>2022-01-14 18:00:03 +0100
commit2f249d62905eb2c6a61703c6cddc317d071b124f (patch)
tree11966dcc62fc19d85b9e2be233ff535d8a9ae7f6
parent7742d516be3480c1736ab030f77d3bf803e0f22f (diff)
downloadrefcat-2f249d62905eb2c6a61703c6cddc317d071b124f.tar.gz
refcat-2f249d62905eb2c6a61703c6cddc317d071b124f.zip
slugify: use builder facilities
-rw-r--r--skate/slugify.go3
1 files changed, 1 insertions, 2 deletions
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()), " ")