Linux technical support - [email protected]


golang installation

# UNDER ROOT
wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz
export GOROOT=/usr/local/go/
export GOPATH=/usr/local/go/bin/
export PATH=$PATH:/usr/local/go/bin

# UNDER USER
mkdir -p /home/gorbachev/go/src/hello
cd /home/gorbachev/go/src/hello
cat > hello.go
package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}
CTRL+D
go build 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>