go标准库: builtin

2020-03-25  本文已影响0人  PhilicX

builtin中包含了一些go语言中内置的类型,常量,函数等;它们实际被实现在语言内部,src/builtin/builtin.go可作为文档使用

类型

type bool bool
const (
    true  = 0 == 0 // Untyped bool.
    false = 0 != 0 // Untyped bool.
)
type uint8 uint8
type uint16 uint16
type uint32 uint32
type uint64 uint64
type int8 int8
type int16 int16
type int32 int32
type int64 int64
type float32 float32
type float64 float64
type complex64 complex64
type complex128 complex128
type string string
type int int
type uint uint
type uintptr uintptr  // 指针类型
type byte = uint8
type rune = int32

方法

func append(slice []Type, elems ...Type) []Type
func copy(dst, src []Type) int
func delete(m map[Type]Type1, key Type)
func len(v Type) int
func cap(v Type) int
func make(t Type, size ...IntegerType) Type
func new(Type) *Type
func complex(r, i FloatType) ComplexType
func real(c ComplexType) FloatType
func imag(c ComplexType) FloatType
func close(c chan<- Type)
func panic(v interface{})
func recover() interface{}
func print(args ...Type)
func println(args ...Type)

接口

type error interface {
    Error() string
}
上一篇 下一篇

猜你喜欢

热点阅读