-
Notifications
You must be signed in to change notification settings - Fork 0
0815import的那些事
ziyouzy edited this page Aug 15, 2020
·
1 revision
import (
"yunhuan2020/mylib/process/importtest"//已实际验证过,可行,正确
)
package testview
import (
"yunhuan2020/mylib/process/importtest"
"yunhuan2020/socketserver/testview/tesviewlv2"
)
已验证可行,同时,tesiewlv2文件夹下的文件名为testviewtwo.go且第一个行为package tesviewlv2
package testview
import (
"yunhuan2020/mylib/process/importtest"
"yunhuan2020/socketserver/testview/tesviewlv2"
)
var TestView testView
type testView struct{
}
func (this *testView)TestViewPrint(){
importtest.Testfmt()
tesviewlv2.TestVLV2("123")
}
函数也是一种类型,函数可以赋值给变量:
func red(){
fmt(xxx)
}
func main(){
var redfunc func()
redfunc =red
redfunc()
}