Golang menghilangkan ruang duplikat

space := regexp.MustCompile(`\s+`)
str := space.ReplaceAllString("Hello  \t \n world!", " ")
fmt.Println(str) // "Hello world!"
Curious Cobra