1
0
mirror of https://github.com/golang/go synced 2024-11-22 07:34:40 -07:00

fix up the 'basic types' section. strings were missing

SVN=118198
This commit is contained in:
Rob Pike 2008-05-08 20:58:15 -07:00
parent f4f588372d
commit b6b8da823d

View File

@ -285,11 +285,11 @@ There are basic types and compound types constructed from them.
Basic types Basic types
---- ----
Go defines a number of basic types, referred to by their Go defines a number of basic types, referred to by their predeclared
predeclared type names. There are signed and unsigned integer type names. These include traditional arithmetic types, booleans,
and floating point types: strings, and a special polymorphic type.
bool the truth values true and false The arithmetic types are:
uint8 the set of all unsigned 8-bit integers uint8 the set of all unsigned 8-bit integers
uint16 the set of all unsigned 16-bit integers uint16 the set of all unsigned 16-bit integers
@ -319,18 +319,27 @@ bits, and the sizes have float <= double.
Also, ``byte'' is an alias for uint8. Also, ``byte'' is an alias for uint8.
Finally, a type ptrint is defined. It is an unsigned integer type An arithmetic type ``ptrint'' is also defined. It is an unsigned
that is the smallest natural integer type of the machine large enough integer type that is the smallest natural integer type of the machine
to store the uninterpreted bits of a pointer value. large enough to store the uninterpreted bits of a pointer value.
Generally, programmers should use these types rather than the explicitly Generally, programmers should use these types rather than the explicitly
sized types to maximize portability. sized types to maximize portability.
Two reserved words, "true" and "false", represent the Other basic types include:
bool the truth values true and false
string immutable strings of bytes
any polymorphic type
Two reserved words, ``true'' and ``false'', represent the
corresponding boolean constant values. corresponding boolean constant values.
There is also a polymorphic type, "any". The "any" type can represent Strings are described in a later section.
a value of any type.
The polymorphic ``any'' type can represent a value of any type.
TODO: we need a section about any
Numeric literals Numeric literals