I write this code for convert TEXT
to BINARY
fmt.Printf("%s
", fmt.Sprintf("%08b", "A"))
and not work, print message: %!b(string=0000000A)
but when i changed "A"
to "A"[0]
work fine:
fmt.Printf("%s
", fmt.Sprintf("%08b", "A"[0]))
output is 01000001
what is difference between above statements?