The C Programming Language, Second Edition
x,X int ; unsigned hexadecimal number (without a leading 0x or 0X ),
using abcdef or ABCDEF for 10, ...,15.
x,X unsigned int ; unsigned hexadecimal notation (without a leading 0x
or 0X ), using abcdef for 0x or ABCDEF for 0X .
The GNU C Library Reference Manual, Version 2.27
‘%x’, ‘%X’ Print an integer as an unsigned hexadecimal number. ‘%x’
uses lower-case letters and ‘%X’ uses upper-case.
I am shocked- shocked- to find that integer conversions are going on here!
In C, implicit conversions abound. In Go, by design, conversions are explicit.
In C, printf implicitly converts a signed integer to unsigned for format %x. Go fmt.Printf does not.
By design, Go is not C. Go does have similarities to C, which may trap the unwary.