How to print byte array in golang?
April 09, 2022Hi Friends 👋,
Welcome To aGuideHub! ❤️
Today, we will learn to print byte array in golang, here we will use the fmt.print()
method to show byte array in output.
Let’s create some byte array
type variable.
package main
import "fmt"
func main() {
b := []byte("ABC€")
s := []byte{65, 66, 67, 226, 130, 172}
fmt.Print(b);
fmt.Print("\n");
fmt.Print(s);
}
In the above code, we have created two variables and print one after one for the output following the below image.
All the best 👍