NOTE : The solution outlined below is not necessarily an optimized version and does not claim to be. The writeup merely serves to present the method that was undertaken to achieve the required outcome and thus forms the basis of the foundational solution.
The code for this solution can be found on my Github.
In the code segment above, a new variable byte_string is created and is assigned the value of the decoded hex_string variable using the hex.DecodeString function.
In addition, it also includes an error handling (which was included in these circumstance to ensure the solution worked as intended) which can be omitted if not required.
Upon decoding, the code above outputs the results to screen using the Println function within the fmt package by formatting the unencoded value within the byte_string into a string.
Running the code up to this point (and assuming no errors) should render the following results:
$ go run solution.go
"The ASCII byte conversion is --> I'm killing your brain like a poisonous mushroom"
Given that the output above looks correct thus far (read: It actually forms a readable sentence), we can assume that we can proceed to the next step, which is to re-encode it to base64 (or radix-64 representation).
We achieve it through the following line of code (which is explained below):
Declares an empty slice of type byte called base64_encode
Calls the base64 package and employs the StdEncoding variable and the EncodeToString function to encode the value raw value held by the byte_string variable
Stores the result of the encoding in the base64_encode slice
The solution then outputs the value of the base64_encode slice to screen for verification, and this is achieved again through the Println function within the fmt package using the line of code below:
fmt.Println("The Base64 encoding of the above is --> ", base64_encode)
Running the code now (and assuming no errors) should render the following results:
$ go run solution.go
"The ASCII byte conversion is --> I'm killing your brain like a poisonous mushroom""The Base64 encoding of the above is --> SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t"
Upon inspection, the value on screen does match the required outcome, thus confirming that the solution works.