Installing Go (GoLang) on CentOS 7.

Installing Go (GoLang) on CentOS 7.

In this post, I will show how to install the Go programming language (GoLang) on CentOS 7. This procedure is quite simple and requires only a few commands.

Install the packages:###

[root@master ~]# yum install golang golang-godoc golang-vet golang-src golang-pkg-linux-amd64 -y

After this we check that the go command could be call and is working:

[root@master ~]# go version
go version go1.4.2 linux/amd64

Hello world! on Go:###

Now we will try to compile and verified Go, to do this we will create a file, name it hello.go and put a sample "hello world" program on it. To do this:

[root@master ~]# cat << EOF > hello.go
package main
import "fmt"
func main() {
fmt.Printf("hello world!\n")

Now we proceed to run the program created before:

[root@master ~]# go run hello.go
hello world!

Now just enjoy Go!