首先下载源码:http://www.golangtc.com/download

解压后,进入src文件夹,执行 ./all.bash

等待安装结束后,把目录复制到/usr/local/里,设置两个环境变量:

export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

然后就可以测试啦 

Create a file named hello.go and put the following program in it:

package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

Then run it with the go tool:

$ go run hello.go
hello, world

If you see the "hello, world" message then Go is installed correctly.

 

听说最新的GO 1.5 使用go来编译go,看来他们是对自己的东西绝对有信心,没bug啦。

相关文章:

  • 2021-11-22
  • 2021-09-02
  • 2021-12-22
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-05
  • 2021-06-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-07-05
  • 2022-01-13
相关资源
相似解决方案