Convert string to kebab case in Go

var re = regexp.MustCompile("[^a-z0-9]+")

func kebabCase(s string) string {
    return strings.Trim(re.ReplaceAllString(strings.ToLower(s), "-"), "-")
}

source