亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
archive archive/tar archive/zip bufio bufio(緩存) builtin builtin(內(nèi)置包) bytes bytes(包字節(jié)) compress compress/bzip2(壓縮/bzip2) compress/flate(壓縮/flate) compress/gzip(壓縮/gzip) compress/lzw(壓縮/lzw) compress/zlib(壓縮/zlib) container container/heap(容器數(shù)據(jù)結(jié)構(gòu)heap) container/list(容器數(shù)據(jù)結(jié)構(gòu)list) container/ring(容器數(shù)據(jù)結(jié)構(gòu)ring) context context(上下文) crypto crypto(加密) crypto/aes(加密/aes) crypto/cipher(加密/cipher) crypto/des(加密/des) crypto/dsa(加密/dsa) crypto/ecdsa(加密/ecdsa) crypto/elliptic(加密/elliptic) crypto/hmac(加密/hmac) crypto/md5(加密/md5) crypto/rand(加密/rand) crypto/rc4(加密/rc4) crypto/rsa(加密/rsa) crypto/sha1(加密/sha1) crypto/sha256(加密/sha256) crypto/sha512(加密/sha512) crypto/subtle(加密/subtle) crypto/tls(加密/tls) crypto/x509(加密/x509) crypto/x509/pkix(加密/x509/pkix) database database/sql(數(shù)據(jù)庫/sql) database/sql/driver(數(shù)據(jù)庫/sql/driver) debug debug/dwarf(調(diào)試/dwarf) debug/elf(調(diào)試/elf) debug/gosym(調(diào)試/gosym) debug/macho(調(diào)試/macho) debug/pe(調(diào)試/pe) debug/plan9obj(調(diào)試/plan9obj) encoding encoding(編碼) encoding/ascii85(編碼/ascii85) encoding/asn1(編碼/asn1) encoding/base32(編碼/base32) encoding/base64(編碼/base64) encoding/binary(編碼/binary) encoding/csv(編碼/csv) encoding/gob(編碼/gob) encoding/hex(編碼/hex) encoding/json(編碼/json) encoding/pem(編碼/pem) encoding/xml(編碼/xml) errors errors(錯(cuò)誤) expvar expvar flag flag(命令行參數(shù)解析flag包) fmt fmt go go/ast(抽象語法樹) go/build go/constant(常量) go/doc(文檔) go/format(格式) go/importer go/parser go/printer go/scanner(掃描儀) go/token(令牌) go/types(類型) hash hash(散列) hash/adler32 hash/crc32 hash/crc64 hash/fnv html html html/template(模板) image image(圖像) image/color(顏色) image/color/palette(調(diào)色板) image/draw(繪圖) image/gif image/jpeg image/png index index/suffixarray io io io/ioutil log log log/syslog(日志系統(tǒng)) math math math/big math/big math/bits math/bits math/cmplx math/cmplx math/rand math/rand mime mime mime/multipart(多部分) mime/quotedprintable net net net/http net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httptrace net/http/httputil net/http/internal net/http/pprof net/mail net/mail net/rpc net/rpc net/rpc/jsonrpc net/smtp net/smtp net/textproto net/textproto net/url net/url os os os/exec os/signal os/user path path path/filepath(文件路徑) plugin plugin(插件) reflect reflect(反射) regexp regexp(正則表達(dá)式) regexp/syntax runtime runtime(運(yùn)行時(shí)) runtime/debug(調(diào)試) runtime/internal/sys runtime/pprof runtime/race(競爭) runtime/trace(執(zhí)行追蹤器) sort sort(排序算法) strconv strconv(轉(zhuǎn)換) strings strings(字符串) sync sync(同步) sync/atomic(原子操作) syscall syscall(系統(tǒng)調(diào)用) testing testing(測試) testing/iotest testing/quick text text/scanner(掃描文本) text/tabwriter text/template(定義模板) text/template/parse time time(時(shí)間戳) unicode unicode unicode/utf16 unicode/utf8 unsafe unsafe
characters

  • import "builtin"

  • 概述

  • 索引

概述

內(nèi)置包提供了 Go 的預(yù)先聲明的標(biāo)識(shí)符的文檔。這里記錄的項(xiàng)目實(shí)際上并不包含在內(nèi)置包中,但是這里的描述允許 godoc 為語言的特殊標(biāo)識(shí)符提供文檔。

索引

  • Constants(常量)

  • Variables(變量)

  • func append(slice []Type, elems ...Type) []Type

  • func cap(v Type) int

  • func close(c chan<- Type)

  • func complex(r, i FloatType) ComplexType

  • func copy(dst, src []Type) int

  • func delete(m map[Type]Type1, key Type)

  • func imag(c ComplexType) FloatType

  • func len(v Type) int

  • func make(t Type, size ...IntegerType) Type

  • func new(Type) *Type

  • func panic(v interface{})

  • func print(args ...Type)

  • func println(args ...Type)

  • func real(c ComplexType) FloatType

  • func recover() interface{}

  • type ComplexType

  • type FloatType

  • type IntegerType

  • type Type

  • type Type1

  • type bool

  • type byte

  • type complex128

  • type complex64

  • type error

  • type float32

  • type float64

  • type int

  • type int16

  • type int32

  • type int64

  • type int8

  • type rune

  • type string

  • type uint

  • type uint16

  • type uint32

  • type uint64

  • type uint8

  • type uintptr

包文件

常量

true 和 false 是兩個(gè)無類型的布爾值。

const (        true  = 0 == 0 // 無類型布爾。        false = 0 != 0 // 無類型布爾。)

iota 是一個(gè)預(yù)先聲明的標(biāo)識(shí)符,表示一個(gè)(通常為括號(hào)的)const聲明中當(dāng)前 const 規(guī)范的無類型整數(shù)序數(shù)。它是零索引的。

const iota = 0 // 無類型int。

變量

nil 是預(yù)先聲明的標(biāo)識(shí)符,表示指針,通道,func,接口,映射或片類型的零值。

var nil Type // 類型必須是指針,通道,函數(shù),接口,映射或片類型

func append

func append(slice []Type, elems ...Type) []Type

追加內(nèi)置函數(shù)將元素追加到切片的末尾。如果它具有足夠的容量,目的地就會(huì)重新適應(yīng)新的元素。如果沒有,則會(huì)分配一個(gè)新的基礎(chǔ)數(shù)組。追加返回更新的切片。因此有必要將追加結(jié)果存儲(chǔ)在保存片本身的變量中:

slice = append(slice, elem1, elem2)slice = append(slice, anotherSlice...)

作為一種特殊情況,將字符串追加到字節(jié)片段是合法的,如下所示:

slice = append([]byte("hello "), "world"...)

func cap

func cap(v Type) int

cap 內(nèi)置函數(shù)根據(jù)其類型返回 v 的容量:

數(shù)組:  v 中的元素?cái)?shù)目(和 len(v)一樣)指向數(shù)組的指針:*v 中的元素?cái)?shù)(與 len(v)相同)。
切片: 重新切片時(shí)切片可達(dá)到的最大長度;
如果v為零,則 cap(v) 為零。
通道:通道緩沖容量,以元素為單位;
如果v為零,則 cap(v) 為零。


func close

func close(c chan<- Type)

關(guān)閉的內(nèi)置函數(shù)關(guān)閉一個(gè)通道,該通道必須是雙向的或只發(fā)送的。它只能由發(fā)送者執(zhí)行,而不能由接收者執(zhí)行,并且在收到最后一次發(fā)送的值后關(guān)閉頻道。在從關(guān)閉的通道c接收到最后一個(gè)值后,從c接收到的任何數(shù)據(jù)將不會(huì)阻塞,返回通道元素的零值。表格

x, ok := <-c

對于一個(gè)封閉的路線,也可以設(shè)置為 false。

func complex

func complex(r, i FloatType) ComplexType

復(fù)雜的內(nèi)置函數(shù)從兩個(gè)浮點(diǎn)值構(gòu)造一個(gè)復(fù)數(shù)值。實(shí)部和虛部必須具有相同的大小,無論是 float32 還是 float64(或可分配給它們),并且返回值將是相應(yīng)的復(fù)雜類型(complex64 代表float32,complex128 代表 float64)。

func copy

func copy(dst, src []Type) int

復(fù)制內(nèi)置函數(shù)將源片段中的元素復(fù)制到目標(biāo)片段中。(作為一種特殊情況,它也會(huì)將字節(jié)中的字節(jié)復(fù)制到一段字節(jié)中。)源和目標(biāo)可能會(huì)重疊。復(fù)制返回復(fù)制的元素?cái)?shù)量,這是 len(src)和len(dst) 的最小值。

func delete

func delete(m map[Type]Type1, key Type)

刪除內(nèi)置函數(shù)從地圖中刪除具有指定鍵 (mkey) 的元素。如果 m 為零或不存在這樣的元素,則刪除是無操作的。

func imag

func imag(c ComplexType) FloatType

圖像內(nèi)置函數(shù)返回復(fù)數(shù) c 的虛部。返回值將是與 c 類型相對應(yīng)的浮點(diǎn)類型。

func len

func len(v Type) int

len 內(nèi)置函數(shù)根據(jù)其類型返回 v 的長度:

數(shù)組:  v 中的元素?cái)?shù)目(和 len(v)一樣)指向數(shù)組的指針:*v 中的元素?cái)?shù)(與 len(v)相同)。
切片,或map: 重新切片時(shí)切片可達(dá)到的最大長度;
如果v為零,則 cap(v) 為零。
通道:通道緩沖容量,以元素為單位;
如果v為零,則 cap(v) 為零。

func make

func make(t Type, size ...IntegerType) Type

make 內(nèi)置函數(shù)分配并初始化 slice ,map 或 (只是)chan類型的對象。像新的一樣,第一個(gè)參數(shù)是一個(gè)類型,而不是一個(gè)值。與 new 不同,make 的返回類型與其參數(shù)類型相同,而不是指向它的指針。結(jié)果的規(guī)格取決于類型:

切片:大小指定長度。切片的容量是
等于它的長度??梢蕴峁┑诙麛?shù)參數(shù)
指定不同的容量; 它必須不小于
length,所以make([] int,0,10)分配一個(gè)長度為0的切片
容量10。
地圖:分配一個(gè)空地圖,有足夠的空間來容納
指定的元素?cái)?shù)量。在這種情況下,可以省略尺寸
分配一個(gè)小的起始大小。
通道:通道的緩沖區(qū)使用指定的初始化
緩沖能力。如果為零,或者省略了大小,則通道為
無緩沖。

func new

func new(Type) *Type

新的內(nèi)置函數(shù)分配內(nèi)存。第一個(gè)參數(shù)是一個(gè)類型,而不是一個(gè)值,返回的值是一個(gè)指向該類型的新分配的零值的指針。

func panic

func panic(v interface{})

panic 內(nèi)置函數(shù)會(huì)停止當(dāng)前 goroutine 的正常執(zhí)行。當(dāng)函數(shù)F調(diào)用 panic 時(shí),F(xiàn) 的正常執(zhí)行立即停止。任何由 F 推遲執(zhí)行的函數(shù)都以通常的方式運(yùn)行,然后 F 返回給它的調(diào)用者。對于調(diào)用者 G 來說,F(xiàn) 的調(diào)用就像調(diào)用 panic 一樣,終止 G 的執(zhí)行并運(yùn)行任何延遲的函數(shù)。這種情況會(huì)持續(xù)下去,直到正在執(zhí)行的 goroutine 中的所有功能都以相反的順序停止。此時(shí),程序終止并報(bào)告錯(cuò)誤情況,包括 panic 的參數(shù)值。該終止序列被稱為 panicking 并且可以通過內(nèi)置的功能恢復(fù)來控制。

func print

func print(args ...Type)

print 內(nèi)置函數(shù)以實(shí)現(xiàn)特定的方式格式化其參數(shù),并將結(jié)果寫入標(biāo)準(zhǔn)錯(cuò)誤。print 對引導(dǎo)和調(diào)試很有用;它不保證維持語言。

func println

func println(args ...Type)

println 內(nèi)置函數(shù)以實(shí)現(xiàn)特定的方式格式化其參數(shù),并將結(jié)果寫入標(biāo)準(zhǔn)錯(cuò)誤??偸窃趨?shù)之間添加空格,并附加一個(gè)換行符。Println 對引導(dǎo)和調(diào)試很有用;它不保證維持語言。

func real

func real(c ComplexType) FloatType

real 的內(nèi)置函數(shù)返回復(fù)數(shù) c 的實(shí)部。返回值將是與 c 類型相對應(yīng)的浮點(diǎn)類型。

func recover

func recover() interface{}

recover 內(nèi)置函數(shù)允許程序管理 panicking 程序的行為。執(zhí)行一個(gè)調(diào)用來恢復(fù)一個(gè)延遲函數(shù)內(nèi)部(但不是由它調(diào)用的任何函數(shù)),通過 recover 正常執(zhí)行來停止 panicking 序列,并檢索傳遞給 panic 調(diào)用的錯(cuò)誤值。如果在延期功能之外調(diào)用 recover,它不會(huì)停止 panicking 序列。在這種情況下,或者當(dāng) goroutine 沒有 panic 時(shí),或者提供給 panic 的參數(shù)為零時(shí),恢復(fù)返回 nil。因此,恢復(fù)報(bào)告的返回值報(bào)告 goroutine 是否為 panicking。

type ComplexType

ComplexType 僅用于文檔目的。它可以用于復(fù)雜類型:complex64 或 complex128。

type ComplexType complex64

type FloatType

FloatType 僅用于文檔目的。它是 float 類型的一個(gè)替代品:float32 或 float64。

type FloatType float32

type IntegerType

IntegerType 僅用于文檔目的。它是任何整數(shù)類型的替身:int,uint,int8 等

type IntegerType int

type Type

Type 僅用于文檔目的。它是任何 Go 類型的替身,但對于任何給定的函數(shù)調(diào)用都表示相同的類型。

type Type int

type Type1

Type1 僅用于文檔目的。它是任何 Go 類型的替身,但對于任何給定的函數(shù)調(diào)用都表示相同的類型。

type Type1 int

type bool

bool 是一組布爾值,true 和 false 。

type bool bool

type byte

byte 是 uint8 的別名,在所有方面等同于 uint8 。按照慣例,它用于區(qū)分8位無符號(hào)整數(shù)值的字節(jié)值。

type byte byte // Really: type byte = uint8 (參見 golang.org/issue/21601)

type complex128

complex128 是所有具有 float64 實(shí)部和虛部的復(fù)數(shù)的集合。

type complex128 complex128

type complex64

complex64 是帶有 float32 實(shí)部和虛部的所有復(fù)數(shù)的集合。

type complex64 complex64

type error

error 內(nèi)置接口類型是用于表示錯(cuò)誤條件的常規(guī)接口,其中nil值表示無錯(cuò)誤。

type error interface {        Error() string}

type float32

float32 是所有IEEE-754 32位浮點(diǎn)數(shù)的集合。

type float32 float32

type float64

float64 是所有IEEE-754 64位浮點(diǎn)數(shù)的集合。

type float64 float64

type int

int 是一個(gè)至少32位大小的有符號(hào)整數(shù)類型。不過,它是一個(gè)獨(dú)特的類型,而不是 int32 的別名。

type int int

type int16

int16 是所有帶符號(hào)16位整數(shù)的集合。范圍:-32768到32767。

type int16 int16

type int32

int32 是所有帶符號(hào)的32位整數(shù)的集合。范圍:-2147483648到2147483647。

type int32 int32

type int64

int64 是所有有符號(hào)的64位整數(shù)的集合。范圍:-9223372036854775808到9223372036854775807。

type int64 int64

type int8

int8 是所有帶符號(hào)的8位整數(shù)的集合。范圍:-128至127。

type int8 int8

type rune

rune 是 int32 的別名,在所有方面等同于 int32。按照慣例,它被用來區(qū)分字符值和整數(shù)值。

type rune rune // Really: type rune = int32 (參見 golang.org/issue/21601)

type string

string 是8位字節(jié)的所有字符串的集合,通常但不一定表示 UTF-8 編碼的文本。一個(gè)字符串可能是空的,但不是零。字符串類型的值是不可變的。

type string string

type uint

uint 是一個(gè)至少32位大小的無符號(hào)整數(shù)類型。然而,這是一種獨(dú)特的類型,而不是 uint32 的別名。

type uint uint

type uint16

uint16 是所有無符號(hào)16位整數(shù)的集合。范圍:0到65535。

type uint16 uint16

type uint32

uint32 是所有無符號(hào)32位整數(shù)的集合。范圍:0到4294967295。

type uint32 uint32

type uint64

uint64 是所有無符號(hào)64位整數(shù)的集合。范圍:0到18446744073709551615。

type uint64 uint64

type uint8

uint8是所有無符號(hào)8位整數(shù)的集合。范圍:0到255。

type uint8 uint8

type uintptr

uintptr是一個(gè)足以容納任何指針的位模式的整數(shù)類型。

type uintptr uintptr
Previous article: Next article: