Commit 7db617b4 authored by Rob Pike's avatar Rob Pike

builtin: document the basic types

The recursive definitions are illegal Go, but godoc doesn't mind.

R=bradfitz, r, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5322067
parent 8089e578
...@@ -10,6 +10,82 @@ ...@@ -10,6 +10,82 @@
*/ */
package builtin package builtin
// bool is the set of boolean values, true and false.
type bool bool
// uint8 is the set of all unsigned 8-bit integers.
// Range: 0 through 255.
type uint8 uint8
// uint16 is the set of all unsigned 16-bit integers.
// Range: 0 through 65535.
type uint16 uint16
// uint32 is the set of all unsigned 32-bit integers.
// Range: 0 through 4294967295.
type uint32 uint32
// uint64 is the set of all unsigned 64-bit integers.
// Range: 0 through 18446744073709551615.
type uint64 uint64
// int8 is the set of all signed 8-bit integers.
// Range: -128 through 127.
type int8 int8
// int16 is the set of all signed 16-bit integers.
// Range: -32768 through 32767.
type int16 int16
// int32 is the set of all signed 32-bit integers.
// Range: -2147483648 through 2147483647.
type int32 int32
// int64 is the set of all signed 64-bit integers.
// Range: -9223372036854775808 through 9223372036854775807.
type int64 int64
// float32 is the set of all IEEE-754 32-bit floating-point numbers.
type float32 float32
// float64 is the set of all IEEE-754 64-bit floating-point numbers.
type float64 float64
// complex64 is the set of all complex numbers with float32 real and
// imaginary parts.
type complex64 complex64
// complex128 is the set of all complex numbers with float64 real and
// imaginary parts.
type complex128 complex128
// string is the set of all strings of 8-bit bytes, conventionally but not
// necessarily representing UTF-8-encoded text. A string may be empty, but
// not nil. Values of string type are immutable.
type string string
// int is a signed integer type that is at least 32 bits in size. It is a
// distinct type, however, and not an alias for, say, int32.
type int int
// uint is an unsigned integer type that is at least 32 bits in size. It is a
// distinct type, however, and not an alias for, say, uint32.
type uint uint
// uintptr is an integer type that is large enough to hold the bit pattern of
// any pointer.
type uintptr uintptr
// 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 byte byte
// rune is an alias for int and is equivalent to int in all ways. It is
// used, by convention, to distinguish character values from integer values.
// In a future version of Go, it will change to an alias of int32.
type rune rune
// Type is here for the purposes of documentation only. It is a stand-in // Type is here for the purposes of documentation only. It is a stand-in
// for any Go type, but represents the same type for any given function // for any Go type, but represents the same type for any given function
// invocation. // invocation.
...@@ -21,11 +97,11 @@ type IntegerType int ...@@ -21,11 +97,11 @@ type IntegerType int
// FloatType is here for the purposes of documentation only. It is a stand-in // FloatType is here for the purposes of documentation only. It is a stand-in
// for either float type: float32 or float64. // for either float type: float32 or float64.
type FloatType int type FloatType float32
// ComplexType is here for the purposes of documentation only. It is a // ComplexType is here for the purposes of documentation only. It is a
// stand-in for either complex type: complex64 or complex128. // stand-in for either complex type: complex64 or complex128.
type ComplexType int type ComplexType complex64
// The append built-in function appends elements to the end of a slice. If // The append built-in function appends elements to the end of a slice. If
// it has sufficient capacity, the destination is resliced to accommodate the // it has sufficient capacity, the destination is resliced to accommodate the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment