?
This document uses PHP Chinese website manual Release
import "go/importer"
Overview
Index
Package importer提供對出口數(shù)據(jù)導(dǎo)入者的訪問。
func Default() types.Importer
func For(compiler string, lookup Lookup) types.Importer
type Lookup
Bugs
importer.go
func Default() types.Importer
默認(rèn)返回構(gòu)建運(yùn)行二進(jìn)制文件的編譯器的導(dǎo)入器。如果可用,結(jié)果將實(shí)現(xiàn)types.ImporterFrom。
func For(compiler string, lookup Lookup) types.Importer
對于從編譯器“gc”和“gccgo”的已安裝軟件包中導(dǎo)入的導(dǎo)入器返回導(dǎo)入器,或者如果編譯器參數(shù)為“源”,則直接從源導(dǎo)入。在后一種情況下,如果導(dǎo)出的API未完全在純Go源代碼中定義(如果包API依賴于cgo定義的實(shí)體,則類型檢查器將無法訪問這些實(shí)體),導(dǎo)入可能會失敗。
如果查找為零,則使用給定編譯器的缺省包查找機(jī)制。
BUG(issue13847):不支持非零查找功能。
Lookup函數(shù)返回讀取器訪問給定導(dǎo)入路徑的包數(shù)據(jù),或者如果找不到匹配的包,則返回錯誤。
type Lookup func(path string) (io.ReadCloser, error)
? 對于不支持非零查找功能。