Go 语言的字符串是不可变的。修改字符串时,可以将字符串转换为 []byte 进行修改,比如:string->[]byte:[]byte(str)
当需要把[]byte 转换为 string 时,可以通过强制类型转换互转,比如:string(byte)
str := "你好zssss never go"
aBytes := []byte(str)
aBytes[0] = '0'
aBytes[1] = '1'
aBytes[2] = '2'
fmt.Println(string(aBytes))