I find type byte byte
very confusing in byte godoc , isn’t supposed to be type byte uint8
?
byte is an alias for uint8 and is equivalent to uint8 in all ways. It is used, by convention, to distinguish byte values from 8-bit unsigned integer values. type complex128
There is no real package builtin
. But to explain the builtins a synthetic package builtin with synthetic types is generated for godoc. The type byte
is never realy declared as type byte byte
simply because byte is builtin and doesn't need a declaration. (And no byte is not and should not be declared as type byte uint8
: byte is bultin and not declared.)
Just ignore the synthetic declarations and read the description. The description is the useful stuff here.
I think the answer is in the presentation of the package:
The items documented here are not actually in package builtin but their descriptions here allow godoc to present documentation for the language's special identifiers.
This syntax has no real meaning, it is just a sort of placeholder for having the type byte
being documented like other (non built-in) types. byte
is defined internally, and the line type byte byte
is never actually encountered. Being internal, it would not be defined as a 'regular' alias of uint8
, which would indeed be type newbyte uint8
(although type newbyte byte
would be as valid and probably clearer).