1、安装

sudo apt-get install golang

2、查看go的安装路径

go env

查看 GOROOT="/usr/lib/go-1.6"

3、修改环境变量

export GOROOT=/usr/lib/go-1.6
export PATH=$PATH:$GOROOT/bin

4、测试

$ go

5、创建hello.go

package main
import "fmt"
func main(){
      fmt.Print("hello,world\n")      
}

6、运行

#go run hello.go
hello,world

  

参考:http://www.361way.com/golang-install/4537.html

相关文章:

  • 2021-12-19
  • 2021-11-29
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-09-12
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2021-12-25
  • 2022-02-21
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案