Skip to content

Instantly share code, notes, and snippets.

@joshuaaguilar20
Created September 6, 2019 22:52
Show Gist options
  • Save joshuaaguilar20/7346d94d65fb3483ac84b0fd2f70d2b2 to your computer and use it in GitHub Desktop.
Save joshuaaguilar20/7346d94d65fb3483ac84b0fd2f70d2b2 to your computer and use it in GitHub Desktop.
Printing Numbers From String to Byte to Hex, Binary
func main() {
s:= "A"
bs:= []byte(s)
fmt.Println(bs)
n:=bs[0]
fmt.Printf("%T \n", n)
fmt.Printf("%b \n", n)
fmt.Printf("%#X\n", n)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment