第一个Go程序
目录结构
C:\USERS\GMBJZG\GOPROJECT
└─src
└─code
└─project01
└─main
hello.exe
hello.go
第一个Go程序
package main
import "fmt"
func main(){
fmt.Println("hello world")
}
注:一个go文件属于一个包
编译
go build hello.go
运行
hello.exe