示例代码如下:
// 表明这个go文件属于main包, 每个文件都属于一个包
package main
// 导入标准输入输出包
import (
"fmt"
)
// 主函数
func main(){
fmt.Println("hello world")
}
wx5ff1414e56729 博主文章分类:Go语言 ©著作权
示例代码如下:
// 表明这个go文件属于main包, 每个文件都属于一个包
package main
// 导入标准输入输出包
import (
"fmt"
)
// 主函数
func main(){
fmt.Println("hello world")
}
第一个go程序
而在1.8版本及之后,如果没有设置GOPATH,Go将使用默认值。os.Args是一个字符串切片,其中第一个
gopath目录gopath目录就是我们存储我们所编写源代码的目录。该目录下往往要有3个
go语言可执行程序需要具备的条件mian包和非mian包的区别
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M