utf8 length
Fix the mistake below to assure the length of utf8 string can be printed correctly.
package main
import (
"fmt"
)
func main() {
fmt.Println(len("你好"))
}
Answer
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
fmt.Println(utf8.RuneCountInString("你好"))
}