convert string to bytes golang code example Example: golang string to bytes hello := []byte("hello-world")