go set up on ubuntu
sudo apt-get install golang-go
package main import ( "fmt" "runtime" ) func main() { fmt.Println("Hellow World!", runtime.Version()) }
执行go run helloWorld.go, 应该会打印出:
或者go build helloWorld.go,将生成helloWorld.sh,./helloWorld也可以运行。
sudo apt-get install golang-go
package main import ( "fmt" "runtime" ) func main() { fmt.Println("Hellow World!", runtime.Version()) }
执行go run helloWorld.go, 应该会打印出:
或者go build helloWorld.go,将生成helloWorld.sh,./helloWorld也可以运行。