Write docs!

This commit is contained in:
nemunaire 2018-03-09 19:07:08 +01:00
parent c460bb7bf5
commit bcc598ebd5
37 changed files with 478 additions and 188 deletions

View file

@ -5,6 +5,7 @@ import (
"strings"
)
// ToURLid converts the given string to a valid URLid.
func ToURLid(str string) string {
re := regexp.MustCompile("[^a-zA-Z0-9]+")
return strings.TrimSuffix(re.ReplaceAllLiteralString(str, "-"), "-")