package main import io "fmt" //引用fmt这个包时,名字重命名为io import _ "os" //引用os这个包,但是不调用,其实就是引用它的init函数 func main() { io.Println("aaaaaaaaaaa") }
执行结果为
GOROOT=C:Go #gosetup GOPATH=E:godevelop #gosetup C:Goingo.exe build -i -o C:UsersaylorAppDataLocalTemp\___go_build__go.exe E:/awesomeProject01/导入包.go #gosetup "C:Program FilesJetBrainsGoLand 2018.1.5in unnerw.exe" C:UsersaylorAppDataLocalTemp\___go_build__go.exe #gosetup aaaaaaaaaaa