go语言是谷歌2009发布的第二款开源编程语言。Go语言专门针对 多处理器系统应用程序的编程进行了优化,使用Go编译的程序可以媲美C或C++代码的速度,而且更加安全、支持并行进程。

还是我自己的电脑,我自己安装的是ubuntu 12.04版本的,直接介绍安装吧!其实搭建环境很简单!

复制代码 代码如下:

sudo apt-get install python-setuptools python-dev build-essential //安装mercurial依赖

sudo easy_install mercurial                                       //安装mercurial

获取go语言包

复制代码 代码如下: hg clone -r release https://go.googlecode.com/hg/ go

编译安装golang

复制代码 代码如下:

cd go/src

./all.bash

ubuntu到这里其实就安装成功了,要配置PATH了,就是我们的windows里的环境变量

复制代码 代码如下:

Installed Go for linux/386 in /home/widuu/source/go

Installed commands in /home/widuu/source/go/bin

*** You need to add /home/widuu/source/go/bin to your PATH.

然后我们弄个文件试试

复制代码 代码如下:

sudo vim hello.go

package main

import “fmt”

func main() {

        fmt.Printf(“hello, 微度网络\n”)

}

go build hello.go

./hello

输出hello,微度网络

声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。