CentOS 7 go语言开发环境搭建(一)

1、下载安装源

下载安装Fedora EPEL安装源

 #rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2、安装golang


# yum install golang -y

3、验证安装成功

[root@bogon ~]# go -version
flag provided but not defined: -version
Go is a tool for managing Go source code.

Usage:

    go command [arguments]

4、编写hello_world.go

package main
import "fmt"
func main(){
    fmt.Println("Hello world")
}
[root@bogon go]# go run hello_world.go 
Hello world

你可能感兴趣的:(go,go语言从入门到精通)