Simplest way to convert a string to a slice of bytes:
[]byte()
A set of examples to convert string to []byte:
package main
import "fmt"
func main() {
stringVariable := "Here is a string...."
// use a string variable
byteSlice := []byte(stringVariable)
// direct string
byteSlice = []byte("Here is a string....")
fmt.Println(string(byteSlice))
}