Golang String to Byte Array

Write a Golang program to convert the given string to the byte array. The byte method converts the string to a byte array. In this example, []byte(strToConvert) will convert the string to a byte array. package main import ( “fmt” ) func main() { var strToConvert string strToConvert = “Hello World” byteString := []byte(strToConvert) fmt.Println(byteString) … Read more