Golang
最新官网 Go.dev https://go.dev
golang.org
golang.google.cn 国内镜像
查看版本 check version:
$ which go
/usr/local/go/bin/go
$ go version
go version go1.22.1 darwin/arm64
create directory helloworld
:
$ mkdir helloworld
$ cd helloworld
create file main.go
:
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, World!")
}
compile and run:
$ go run main.go
Hello, World!