byte == uint8
    rune == int32

    1. package main
    2. import (
    3. "fmt"
    4. )
    5. func main() {
    6. s := reverse("冉rxy!")
    7. fmt.Println(s)
    8. }
    9. func reverse(s string) string {
    10. var r = []rune(s)
    11. for i, j := 0, len(r)-1; i < j; i++ {
    12. r[i], r[j] = r[j], r[i]
    13. j--
    14. }
    15. return string(r)
    16. }

    []byte to string:
    string(b)