lost and found ( for me ? )

Install go language by using gvm

about gvm.
https://github.com/moovweb/gvm

You can install specific Go version and switch go version from one to another with gvm.

install required packages to build gvm
# tail -1 /etc/lsb-release ;uname –ri
DISTRIB_DESCRIPTION="Ubuntu 13.10"
3.11.0-19-generic x86_64

# apt-get install curl git mercurial make binutils bison gcc build-essential

install gvm

# source /root/.gvm/scripts/gvm

# which gvm
/root/.gvm/bin/gvm

install go 1.2
# gvm install go1.2
Downloading Go source...
Installing go1.2...
* Compiling...

# gvm list

gvm gos (installed)

  go1.2

# gvm use go1.2 --default
Now using version go1.2

# go version
go version go1.2 linux/amd64

# which go
/root/.gvm/gos/go1.2/bin/go

# cat hello_world.go
package main

import "fmt"

func main() {
   fmt.Println("hello world")
}

# go run hello_world.go
hello world

# go build hello_world.go

# ./hello_world
hello world

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.