Go Programming Tips
Add 0x prefix when printing hex numbers
Use %#x
placeholder.
1 | func TestPrintHex() { |
1 | 123456 |
Print the type of a variable
1 | fmt.Printf("%T\n", i) |
Use %#x
placeholder.
1 | func TestPrintHex() { |
1 | 123456 |
1 | fmt.Printf("%T\n", i) |