main.go
package main
import "fmt"
func main () {
fmt.Println("Hello World")
}
解释执行:
go run main.go
编译执行:
go build main.go
./mian
go build -o hello main.go
./hello
main.go
package main
import "fmt"
func main () {
fmt.Println("Hello World")
}
解释执行:
go run main.go
编译执行:
go build main.go
./mian
go build -o hello main.go
./hello