ref:
http://golang.org/doc/install.html
Install go and say hello
* step1:add variables to PATH
for example:
export GOROOT=/home/eric/program/go
export GOARCH=386
export GOOS=linux
different os,cpu has different value,refer to:
http://golang.org/doc/install.html
make sure user has permission to operate GOROOT folder and create it,if not,install might be fail,
there is another var $GOBIN which is optional,default to $HOME/bin,so you need to create $HOME/bin if not exist,or you can specify it in PATH as above three var(but when I try to specify it,I failed,so I use the default $HOME/bin,of cause I create it first).
* step2: make sure PATH is ok
logout and login so than the PATH change,then use follow commond to test whether PATH is correct:
$ env | grep '^GO'
* step3:Fetch the repository
install mercurial first with follow commond:
sudo apt-get install mercurial
get repository with follow commond:
$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT
* step4:install some required thing
$ sudo apt-get install bison gcc libc6-dev ed make
* step5:install go
$ cd $GOROOT/src
$ make all
If "make all" goes well, it will finish by printing:
--- cd ../test
N known bugs; 0 unexpected bugs
* step6:
you have finish install go on ubuntu9.10,
![](/images/smiles/icon_lol.gif)
you might need relogin,I don't need on standalone linux,but need on vmware,
* step7:say hello
cd ~
gedit hello.go
hello.go:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
compile hello.go,take 386 cpu for example,with other cpu,refer to
http://golang.org/doc/install.html
8g hello.go
8l hello.8
run it:
./8.out
"hello,world" here we go,finish!
*
分享到:
相关推荐
ubuntu910界面汉化安装包,deb格式。由于包的相互依赖,需用如下命令安装: #dpkg -i language-pack-gnome-zh-hans_1%3a9.10+20091022_all.deb language-pack-gnome-zh-hans-base_1%3a9.10+20091022_all.deb #dpkg -...
ubuntu9.10的用户指南汉化包,deb格式.
先说一下安装环境,我的电脑分为4个盘:C(NTFS格式,Windows XP系统)、D、E、F(这三个是FAT32格式),我把Ubuntu9.10装在E盘,E盘事先被清空。 第一步:把ubuntu-9.10-desktop-i386.iso 文件拷贝到非安装盘,比如...
很详细的 Ubuntu 9.10 图解安装教程
ubuntu 智能拼音安装方法(个人比较中意这个输入法)
ubuntu9.10的源,用于更新; Archive.ubuntu.com更新服务器(欧洲,此为官方源,电信网通用户使用): deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse deb ...
ubuntu910的ibus输入法,由于附件大小的限制,分开成两个资源上传.
Win 7 与 Ubuntu9.10系统安装顺序 (1)Win7 (2)Ubuntu9.10,注意在安装步骤第7步的时候,点击高级按钮,选择安装启动器引导设备的位置为你手动分区的那个光盘。 (3)登录win7(此时系统直接进入win7的),将此...
硬盘安装 windows 7 和 ubuntu 9.10 双系统 Windows 7 和 ubuntu 都已经发布了,想体验一下。 Windows 7 已经安装了,本来想用 wubi 安装 ubuntu ,担心 ubuntu 系统性能不好,使用虚拟机安装吧,也是担心同样的...
安装 Ubuntu 9.10 全过程视频教程
ubuntu 9.10网易最快的源 ubuntu 9.10网易最快的源
eclipse3.6+ubuntu9.10配色方案 eclipse3.6+ubuntu9.10配色方案 eclipse3.6+ubuntu9.10配色方案
用虚拟机在移动硬盘上安装Ubuntu 9.10 视屏
Ubuntu 9.10 安装 Mediawiki 脚本
Ubuntu icons svg files Ubuntu9.10
ubuntu 9.10更新源(速度最快的) ubuntu 9.10更新源(速度最快的) ubuntu 9.10更新源(速度最快的) ubuntu 9.10更新源(速度最快的)
步骤很详细,我本人已经安装成功,初次安装的新手,找上面的操作,保证OK!
Ubuntu 9.10 拨号错误解决方法
ubuntu9.10上openoffice界面的汉化包,deb格式.
本文是本人在使用LINUX过程中的一些体会,以ubuntu9.10为例,详细讲述安装,及一些基本软件及应用。本论文以如何把linux打造成适合学生使用的系统为题,故将重点放在联网(只适合中山大学东校区),windows下常用的...