slug is a Go library for generating URL-friendly slugs.
Before and after:
A Lovely Day→a-lovely-dayLiving in 北京→living-in-bei-jing
package main
import "github.com/peferron/slug"
func main() {
s := slug.Generate("Hello World")
print(s) // Prints "hello-world"
}See the full API reference.