Setup GO Language in Linux and test run
Bellow is the process for setting up GO Language in centos 7 or ubuntu 18.04
Download package
$ wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz
extract binary
$ tar -C /usr/local -xzf go1.14.linux-amd64.tar.gz
setup path
$ export PATH=$PATH:/usr/local/go/bin
set permanent path in user profile
$ vim ~/.bash_profile
create environment directory
$ mkdir ~/go
create a test programm
$ mkdir ~/go/src/hello -p
$ cd go/src/hello/
$ vim hello.go
--
package main
import "fmt"
func main() {
fmt.Printf("Hello, World\n")
}
--
$ go build
$ ./hello
Comments
Post a Comment