Golang Install
on Ubuntu/Mint/Debian
on Ubuntu/Mint/Debian
Update repos
apt-get update
get the tar ball
sudo curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
untar pkg
tar -xvf go1.6.linux-amd64.tar.gz
Move to usr directory
mv go /usr/local
Set Env
vi ~/.profile
export GOROOT=/usr/local/go
export GOPATH=/home/user/golang
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
create new project
mkdir $GOPATH/projectName/src/github.com/YourGitName/
vi hello.go
package main
import "fmt"
func main () {
fmt.Println("hello world")
}
Run the test code
go run $GOPATH/projectName/hello.go