Basically what I'm trying to do is convert a string in the hexidecimal format to a byte and append the byte to a byte slice.
I've tried:
func main() {
bytes := []byte{0xfc}
string := "0xe8"
bytes = append(bytes, string...)
fmt.Printf("%s", bytes)
}
output:
�0xe8
I know I could just declare a byte variable and append the byte. I need to convert the string into a byte.
Expected output:
��
strconv.ParseInt